Installing dependencies.
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
coverage
|
||||
node_modules
|
||||
*.log
|
||||
*.dump
|
||||
*.swp
|
||||
.DS_Store
|
||||
.nyc_output
|
||||
+1
@@ -0,0 +1 @@
|
||||
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
notifications:
|
||||
email: false
|
||||
node_js:
|
||||
- iojs-v2
|
||||
- iojs-v1
|
||||
- '0.12'
|
||||
- '0.10'
|
||||
before_install:
|
||||
- npm i -g npm@^2.0.0
|
||||
before_script:
|
||||
- npm prune
|
||||
- 'curl -Lo travis_after_all.py https://git.io/vLSON'
|
||||
after_success:
|
||||
- npm run coverage:upload
|
||||
- python travis_after_all.py
|
||||
- export $(cat .to_export_back)
|
||||
- npm run semantic-release
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
# nerf-dart
|
||||
|
||||
[](https://travis-ci.org/boennemann/nerf-dart)
|
||||
[](https://coveralls.io/github/boennemann/nerf-dart?branch=master)
|
||||
[](https://david-dm.org/boennemann/nerf-dart/next)
|
||||
[](https://david-dm.org/boennemann/nerf-dart/next#info=dependencies)
|
||||
|
||||
> Maps a URL to an identifier.
|
||||
|
||||
```js
|
||||
|
||||
var toNerfDart = require('nerf-dart')
|
||||
|
||||
toNerfDart('http://registry.npmjs.org')
|
||||
// //registry.npmjs.org/
|
||||
```
|
||||
|
||||
Originally from [npm](http://npmjs.com/). Taken from https://github.com/npm/npm/blob/master/lib/config/nerf-dart.js and made available as a standalone package for easier reuse.
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// taken from https://github.com/npm/npm/blob/master/lib/config/nerf-dart.js
|
||||
// originally from npm http://npmjs.com/
|
||||
|
||||
var url = require('url')
|
||||
|
||||
module.exports = toNerfDart
|
||||
|
||||
/**
|
||||
* Maps a URL to an identifier.
|
||||
*
|
||||
* Name courtesy schiffertronix media LLC, a New Jersey corporation
|
||||
*
|
||||
* @param {String} uri The URL to be nerfed.
|
||||
*
|
||||
* @returns {String} A nerfed URL.
|
||||
*/
|
||||
function toNerfDart (uri) {
|
||||
var parsed = url.parse(uri)
|
||||
delete parsed.protocol
|
||||
delete parsed.auth
|
||||
delete parsed.query
|
||||
delete parsed.search
|
||||
delete parsed.hash
|
||||
|
||||
return url.resolve(url.format(parsed), '.')
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "nerf-dart",
|
||||
"description": "maps a URL to an identifier",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"coverage": "nyc report",
|
||||
"coverage:upload": "npm run coverage -- --reporter=text-lcov | coveralls",
|
||||
"test": "standard && nyc tap --no-cov test.js",
|
||||
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/boennemann/nerf-dart.git"
|
||||
},
|
||||
"keywords": [
|
||||
"url",
|
||||
"identifier"
|
||||
],
|
||||
"author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me/)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/boennemann/nerf-dart/issues"
|
||||
},
|
||||
"homepage": "https://github.com/boennemann/nerf-dart#readme",
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.11.4",
|
||||
"nyc": "^3.1.0",
|
||||
"semantic-release": "^4.1.0",
|
||||
"standard": "^5.1.0",
|
||||
"tap": "^1.3.2"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// taken from https://raw.githubusercontent.com/indexzero/npm/bd3cad01fbd3ab481d2f5da441b9eead16029123/test/tap/config-nerf-dart.js
|
||||
// originally written by Charlie Robbins, https://github.com/indexzero
|
||||
var test = require('tap').test
|
||||
var toNerfDart = require('./')
|
||||
|
||||
function validNerfDart (uri, valid) {
|
||||
if (!valid) valid = '//registry.npmjs.org/'
|
||||
test(uri, function (t) {
|
||||
t.equal(toNerfDart(uri), valid)
|
||||
t.end()
|
||||
})
|
||||
}
|
||||
|
||||
validNerfDart('http://registry.npmjs.org')
|
||||
validNerfDart('http://registry.npmjs.org/some-package')
|
||||
validNerfDart('http://registry.npmjs.org/some-package?write=true')
|
||||
validNerfDart('http://user:pass@registry.npmjs.org/some-package?write=true')
|
||||
validNerfDart('http://registry.npmjs.org/#random-hash')
|
||||
validNerfDart('http://registry.npmjs.org/some-package#random-hash')
|
||||
|
||||
validNerfDart(
|
||||
'http://relative.couchapp.npm/design/-/rewrite/',
|
||||
'//relative.couchapp.npm/design/-/rewrite/'
|
||||
)
|
||||
validNerfDart(
|
||||
'http://relative.couchapp.npm:8080/design/-/rewrite/',
|
||||
'//relative.couchapp.npm:8080/design/-/rewrite/'
|
||||
)
|
||||
validNerfDart(
|
||||
'http://relative.couchapp.npm:8080/design/-/rewrite/some-package',
|
||||
'//relative.couchapp.npm:8080/design/-/rewrite/'
|
||||
)
|
||||
Reference in New Issue
Block a user