Skip to content

Commit eece8f6

Browse files
committed
Initial commit
0 parents  commit eece8f6

File tree

12 files changed

+4226
-0
lines changed

12 files changed

+4226
-0
lines changed

.appveyor.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
environment:
2+
matrix:
3+
- nodejs_version: "4"
4+
- nodejs_version: "6"
5+
- nodejs_version: "8"
6+
7+
install:
8+
- ps: Install-Product node $env:nodejs_version
9+
- npm config set loglevel warn
10+
- npm i -g npm
11+
- npm i
12+
13+
test_script:
14+
- node --version
15+
- npm --version
16+
- npm test
17+
18+
build: off

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"env"
4+
]
5+
}

.eslintrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "airbnb-base",
3+
"plugins": [
4+
"import"
5+
],
6+
"rules": {
7+
"arrow-parens": 0
8+
}
9+
}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
npm-debug.log
3+
dest
4+
.nyc*
5+
coverage
6+
.DS_STORE
7+
.vscode

.npmignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
lib
2+
.nyc_output
3+
coverage
4+
test
5+
.babelrc
6+
.eslintrc
7+
.travis.yml
8+
appveyor.yml
9+
yarn.lock

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: node_js
2+
sudo: true
3+
dist: trusty
4+
node_js:
5+
- "4"
6+
- "6"
7+
- "8"
8+
install:
9+
- yarn
10+
script: npm test
11+
notifications:
12+
email:
13+
on_failure: change
14+
on_success: change
15+
after_success:
16+
- npm run coveralls

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Lukas Aichbauer
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# is-git-remote
2+
3+
> Check if a git remote repository exists
4+
5+
## LICENSE
6+
7+
MIT © Lukas Aichbauer

lib/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import execa from 'execa';
2+
import inputIs from 'input-is';
3+
4+
const isGitRemte = (URL, host) => {
5+
let thisURL = URL;
6+
const thisHost = host || 'github.com';
7+
8+
if (inputIs.url(thisURL) && !inputIs.valid(thisURL, /https:\/\//)) {
9+
thisURL = `https://${thisURL}`;
10+
} else if (!inputIs.url(thisURL) && inputIs.valid(thisURL, /.\/./)) {
11+
thisURL = `https://www.${thisHost}/${thisURL}`;
12+
}
13+
14+
try {
15+
execa.shellSync(`git ls-remote ${thisURL}`);
16+
return true;
17+
} catch (e) {
18+
return false;
19+
}
20+
};
21+
22+
export default isGitRemte;

package.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "is-git-remote",
3+
"version": "0.0.0",
4+
"description": "Check if a git remote repository exists",
5+
"main": "./dest/index.js",
6+
"scripts": {
7+
"pretest": "npm run lint & npm run babel",
8+
"test": "nyc ava",
9+
"lint": "eslint lib test",
10+
"babel": "babel lib -d dest",
11+
"prepublish": "npm run babel",
12+
"prepush": "npm test",
13+
"coveralls": "nyc report --reporter=text-lcov | coveralls"
14+
},
15+
"ava": {
16+
"require": [
17+
"babel-register",
18+
"babel-polyfill"
19+
],
20+
"babel": "inherit"
21+
},
22+
"nyc": {
23+
"exclude": [
24+
"test",
25+
"dest"
26+
]
27+
},
28+
"repository": {
29+
"type": "git",
30+
"url": "git+https://github.com/aichbauer/node-is-git-remote.git"
31+
},
32+
"author": "Lukas Aichbauer <>",
33+
"license": "MIT",
34+
"bugs": {
35+
"url": "https://github.com/aichbauer/node-is-git-remote/issues"
36+
},
37+
"keywords": [
38+
"git",
39+
"remote",
40+
"exists",
41+
"is-git-remote"
42+
],
43+
"homepage": "https://github.com/aichbauer/node-is-git-remote#readme",
44+
"devDependencies": {
45+
"ava": "^0.18.2",
46+
"babel-cli": "^6.26.0",
47+
"babel-polyfill": "^6.23.0",
48+
"babel-preset-env": "^1.2.1",
49+
"coveralls": "^2.12.0",
50+
"eslint": "^3.17.1",
51+
"eslint-config-airbnb-base": "^11.1.1",
52+
"eslint-plugin-import": "^2.2.0",
53+
"husky": "^0.13.2",
54+
"nyc": "^10.1.2"
55+
},
56+
"dependencies": {
57+
"execa": "^0.8.0",
58+
"input-is": "^1.1.2"
59+
}
60+
}

0 commit comments

Comments
 (0)