First release
This commit is contained in:
commit
fa6c85266e
2339 changed files with 761050 additions and 0 deletions
4
node_modules/individual/.npmignore
generated
vendored
Normal file
4
node_modules/individual/.npmignore
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
node_modules
|
||||
*.log
|
||||
*.err
|
||||
coverage
|
7
node_modules/individual/.travis.yml
generated
vendored
Normal file
7
node_modules/individual/.travis.yml
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- "0.8"
|
||||
- "0.10"
|
||||
- "0.11"
|
||||
before_install: npm i npm@latest -g
|
||||
script: npm run travis
|
19
node_modules/individual/LICENCE
generated
vendored
Normal file
19
node_modules/individual/LICENCE
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2012 Raynos.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
69
node_modules/individual/README.md
generated
vendored
Normal file
69
node_modules/individual/README.md
generated
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
# individual
|
||||
|
||||
[![build status][build-png]][build] [![Coverage Status][cover-png]][cover] [![Davis Dependency status][dep-png]][dep]
|
||||
|
||||
[![NPM][npm-png]][npm]
|
||||
|
||||
[![browser support][test-png]][test]
|
||||
|
||||
Garantueed individual values
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var Individual = require("individual")
|
||||
|
||||
var moduleCache = Individual("__MY_MODULE_CACHE", {})
|
||||
|
||||
// moduleCache is a individual variable local to this file.
|
||||
// It will always be the same value and defaults to {}.
|
||||
```
|
||||
|
||||
This gives you a singleton value by a unique name (it stores it
|
||||
as a global variable).
|
||||
|
||||
## Use cases
|
||||
|
||||
Your module has an internal cache. If your module is loaded
|
||||
twice, (someone didn't npm dedup and has two copies of your
|
||||
module) you would have two seperate caches that dont talk
|
||||
to each other.
|
||||
|
||||
Best case your cache is less efficient. Worst case you have a
|
||||
cache because the native C++ extension you talk to crashes
|
||||
if you instantiate something twice.
|
||||
|
||||
You need a garantuee that this value is an individual, there is
|
||||
only one of it.
|
||||
|
||||
I use it myself because opening a SockJS websocket to the same
|
||||
URI twice causes an infinite loop. I need a garantuee that
|
||||
I have an individual value for the SockJS connection so I
|
||||
can see whether I already have an open connection.
|
||||
|
||||
## WHY GLOBALS >:(
|
||||
|
||||
I can't imagine any other way to do it. I hate it too. Make a
|
||||
pull request if you know the real solution
|
||||
|
||||
## Installation
|
||||
|
||||
`npm install individual`
|
||||
|
||||
## Contributors
|
||||
|
||||
- Raynos
|
||||
|
||||
## MIT Licenced
|
||||
|
||||
[build-png]: https://secure.travis-ci.org/Raynos/individual.png
|
||||
[build]: https://travis-ci.org/Raynos/individual
|
||||
[cover-png]: https://coveralls.io/repos/Raynos/individual/badge.png
|
||||
[cover]: https://coveralls.io/r/Raynos/individual
|
||||
[dep-png]: https://david-dm.org/Raynos/individual.png
|
||||
[dep]: https://david-dm.org/Raynos/individual
|
||||
[test-png]: https://ci.testling.com/Raynos/individual.png
|
||||
[test]: https://ci.testling.com/Raynos/individual
|
||||
[npm-png]: https://nodei.co/npm/individual.png?stars&downloads
|
||||
[npm]: https://nodei.co/npm/individual
|
||||
|
18
node_modules/individual/index.js
generated
vendored
Normal file
18
node_modules/individual/index.js
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
var root = typeof window !== 'undefined' ?
|
||||
window : typeof global !== 'undefined' ?
|
||||
global : {};
|
||||
|
||||
module.exports = Individual
|
||||
|
||||
function Individual(key, value) {
|
||||
if (root[key]) {
|
||||
return root[key]
|
||||
}
|
||||
|
||||
Object.defineProperty(root, key, {
|
||||
value: value
|
||||
, configurable: true
|
||||
})
|
||||
|
||||
return value
|
||||
}
|
84
node_modules/individual/package.json
generated
vendored
Normal file
84
node_modules/individual/package.json
generated
vendored
Normal file
|
@ -0,0 +1,84 @@
|
|||
{
|
||||
"_from": "individual@^2.0.0",
|
||||
"_id": "individual@2.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-gzsJfa0jKU52EXqY+zjg2a1hu5c=",
|
||||
"_location": "/individual",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "individual@^2.0.0",
|
||||
"name": "individual",
|
||||
"escapedName": "individual",
|
||||
"rawSpec": "^2.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/rust-result"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/individual/-/individual-2.0.0.tgz",
|
||||
"_shasum": "833b097dad23294e76117a98fb38e0d9ad61bb97",
|
||||
"_spec": "individual@^2.0.0",
|
||||
"_where": "F:\\Documents\\websites\\BMM\\node_modules\\rust-result",
|
||||
"author": {
|
||||
"name": "Raynos",
|
||||
"email": "raynos2@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Raynos/individual/issues",
|
||||
"email": "raynos2@gmail.com"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jake Verbaten"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "Garantueed individual values",
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.10.0",
|
||||
"istanbul": "^0.2.7",
|
||||
"run-browser": "^1.3.1",
|
||||
"tape": "^2.12.3"
|
||||
},
|
||||
"homepage": "https://github.com/Raynos/individual",
|
||||
"keywords": [],
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://github.com/Raynos/individual/raw/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"main": "index",
|
||||
"name": "individual",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Raynos/individual.git"
|
||||
},
|
||||
"scripts": {
|
||||
"cover": "istanbul cover --report none --print detail test.js",
|
||||
"test": "node test.js",
|
||||
"travis": "npm run cover -s && istanbul report lcov && ((cat coverage/lcov.info | coveralls) || exit 0)"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"firefox/16..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/22..latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
},
|
||||
"version": "2.0.0"
|
||||
}
|
25
node_modules/individual/test.js
generated
vendored
Normal file
25
node_modules/individual/test.js
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
var test = require('tape');
|
||||
|
||||
var Individual = require('./index.js');
|
||||
|
||||
test('can create Individual', function (assert) {
|
||||
var obj = Individual('someName', 42);
|
||||
|
||||
assert.equal(obj, 42);
|
||||
|
||||
var obj2 = Individual('someName', 50);
|
||||
|
||||
assert.equal(obj, 42);
|
||||
|
||||
assert.end();
|
||||
});
|
||||
|
||||
test('different keys', function (assert) {
|
||||
var obj = Individual('someName2', 42);
|
||||
var obj2 = Individual('otherName2', 50);
|
||||
|
||||
assert.equal(obj, 42);
|
||||
assert.equal(obj2, 50);
|
||||
|
||||
assert.end();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue