added all files to project

This commit is contained in:
2022-03-10 10:36:59 +01:00
parent 09dd957b33
commit 46a936d7de
25351 changed files with 3883356 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
npm-debug.log
node_modules
+4
View File
@@ -0,0 +1,4 @@
language: node_js
node_js:
- "0.8"
- "0.10"
+23
View File
@@ -0,0 +1,23 @@
Copyright 2013 Thorsten Lorenz.
All rights reserved.
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.
+38
View File
@@ -0,0 +1,38 @@
# dev-null [![build status](https://secure.travis-ci.org/thlorenz/dev-null.png)](http://travis-ci.org/thlorenz/dev-null)
`/dev/null` for node streams
Use it whenever you need to interrupt stream flow for instance if you want to log the state of a stream instead of its
output.
```js
// without devnull
var numbers = require('../test/fixtures/number-readable')
numbers({ to: 2 })
.on('data', function (d) { console.log(d.toString()) });
// =>
// 0
// 1
// 2
```
```js
// piping into devnull
var devnull = require('dev-null');
var numbers = require('../test/fixtures/number-readable');
numbers({ to: 2 })
.pipe(devnull())
.on('data', function (d) { console.log(d.toString()) });
// => (no output)
```
## Installation
npm install dev-null
## License
MIT
+6
View File
@@ -0,0 +1,6 @@
var devnull = require('../');
var numbers = require('../test/fixtures/number-readable');
numbers({ to: 3 })
.pipe(devnull())
.on('data', function (d) { console.log(d.toString()) });
+4
View File
@@ -0,0 +1,4 @@
var numbers = require('../test/fixtures/number-readable')
numbers({ to: 3 })
.on('data', function (d) { console.log(d.toString()) });
+22
View File
@@ -0,0 +1,22 @@
'use strict';
var util = require('util')
, stream = require('stream')
, Writable = stream.Writable
, setImmediate = setImmediate || function (fn) { setTimeout(fn, 0) }
;
module.exports = DevNull;
util.inherits(DevNull, Writable);
function DevNull (opts) {
if (!(this instanceof DevNull)) return new DevNull(opts);
opts = opts || {};
Writable.call(this, opts);
}
DevNull.prototype._write = function (chunk, encoding, cb) {
setImmediate(cb);
}
+74
View File
@@ -0,0 +1,74 @@
{
"_args": [
[
"dev-null@0.1.1",
"/home/pi/Desktop/smartMirrorTestEnvironment/MagicMirror"
]
],
"_development": true,
"_from": "dev-null@0.1.1",
"_id": "dev-null@0.1.1",
"_inBundle": false,
"_integrity": "sha1-WiBc48Ky73e2I41roXnrdMag6Bg=",
"_location": "/dev-null",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "dev-null@0.1.1",
"name": "dev-null",
"escapedName": "dev-null",
"rawSpec": "0.1.1",
"saveSpec": null,
"fetchSpec": "0.1.1"
},
"_requiredBy": [
"/spectron"
],
"_resolved": "https://registry.npmjs.org/dev-null/-/dev-null-0.1.1.tgz",
"_spec": "0.1.1",
"_where": "/home/pi/Desktop/smartMirrorTestEnvironment/MagicMirror",
"author": {
"name": "Thorsten Lorenz",
"email": "thlorenz@gmx.de",
"url": "http://thlorenz.com"
},
"bugs": {
"url": "https://github.com/thlorenz/dev-null/issues"
},
"dependencies": {},
"description": "/dev/null for node streams",
"devDependencies": {
"nave": "~0.4.3",
"tap": "~0.4.3",
"tap-stream": "~0.2.0"
},
"engine": {
"node": ">=0.10"
},
"homepage": "https://github.com/thlorenz/dev-null",
"keywords": [
"streams",
"test",
"debug",
"ignore",
"silence"
],
"license": {
"type": "MIT",
"url": "https://github.com/thlorenz/dev-null/blob/master/LICENSE"
},
"main": "index.js",
"name": "dev-null",
"repository": {
"type": "git",
"url": "git://github.com/thlorenz/dev-null.git"
},
"scripts": {
"test": "if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi",
"test-0.10": "nave use 0.10 npm run test-main",
"test-all": "npm run test-main && npm run test-0.10",
"test-main": "tap test/*.js"
},
"version": "0.1.1"
}
+21
View File
@@ -0,0 +1,21 @@
'use strict';
var util = require('util')
, stream = require('stream')
, Readable = stream.Readable
module.exports = NumberReadable;
util.inherits(NumberReadable, Readable);
function NumberReadable (opts) {
if (!(this instanceof NumberReadable)) return new NumberReadable(opts);
Readable.call(this, opts);
this.idx = 0;
this.to = opts.to;
}
NumberReadable.prototype._read = function () {
if (this.idx > this.to) return this.push(null);
this.push('' + this.idx++);
}
+28
View File
@@ -0,0 +1,28 @@
'use strict';
/*jshint asi: true */
var test = require('tap').test
var devnull = require('../');
var tapstream = require('tap-stream')
var numbers = require('./fixtures/number-readable')
test('\npiping without devnull', function (t) {
var data = [];
numbers({ to: 2 })
.on('data', function (d) { data.push(d) })
.on('end', function () {
t.equal(data.length, 3, 'streams 3 numbers')
t.end()
})
})
test('\npiping through devnull', function (t) {
var data = [];
numbers({ to: 2 })
.on('end', function () {
t.equal(data.length, 0, 'streams 0 numbers')
t.end()
})
.pipe(devnull())
.on('data', function (d) { data.push(d) })
})