node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

3
server/node_modules/stream-slice/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,3 @@
node_modules
*.DS_Store

4
server/node_modules/stream-slice/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,4 @@
language: node_js
node_js:
- "0.10"
- "0.11"

35
server/node_modules/stream-slice/README.md generated vendored Normal file
View File

@@ -0,0 +1,35 @@
stream-slice [![Build Status](https://travis-ci.org/yorkie/stream-slice.svg?branch=master)](https://travis-ci.org/yorkie/koa-range)
==========================
slicing stream like buffer/string
### Installation
```sh
$ npm install stream-slice --save
```
### Usage
```js
var fs = require('fs');
var slice = require('stream-slice').slice;
fs.createReadStream('your path')
.pipe(slice(10, 100))
.on('data', function() {
// here we only get the buffer from 10th to 100th.
});
```
slicing file
```js
var fs = require('fs');
var slice = require('stream-slice').slice;
fs.createReadStream('sourc file path')
.pipe(slice(0, 200))
.pipe(fs.createWriteStream('dest file path'));
```
### License
MIT

53
server/node_modules/stream-slice/index.js generated vendored Normal file
View File

@@ -0,0 +1,53 @@
var util = require('util');
var Transform = require('stream').Transform;
util.inherits(SliceStream, Transform);
function SliceStream(start, end) {
if (!(this instanceof SliceStream)) {
return new SliceStream();
}
Transform.call(this);
this._start = start || 0;
this._end = end || Infinity;
this._offset = 0;
this._state = 0;
this._emitUp = false;
this._emitDown = false;
}
SliceStream.prototype._transform = function(chunk, encoding, done) {
this._offset += chunk.length;
if (!this._emitUp && this._offset >= this._start) {
this._emitUp = true;
var start = chunk.length - (this._offset - this._start);
if(this._offset > this._end)
{
var end = chunk.length - (this._offset - this._end);
this._emitDown = true;
this.push(chunk.slice(start, end));
}
else
{
this.push(chunk.slice(start, chunk.length));
}
return done();
}
if (this._emitUp && !this._emitDown) {
if (this._offset >= this._end) {
this._emitDown = true;
this.push(chunk.slice(0, chunk.length - (this._offset - this._end)));
} else {
this.push(chunk);
}
return done();
}
return done();
}
exports.slice = function(start, end) {
return new SliceStream(start, end);
}

26
server/node_modules/stream-slice/package.json generated vendored Normal file
View File

@@ -0,0 +1,26 @@
{
"name": "stream-slice",
"version": "0.1.2",
"description": "slice stream like buffer/string",
"main": "index.js",
"scripts": {
"test": "tape test.js"
},
"repository": {
"type": "git",
"url": "git@github.com:yorkie/stream-slice.git"
},
"keywords": [
"slice",
"stream"
],
"author": "Yorkie Neil <yorkiefixer@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/yorkie/stream-slice/issues"
},
"homepage": "https://github.com/yorkie/stream-slice",
"devDependencies": {
"tape": "^2.13.2"
}
}

46
server/node_modules/stream-slice/test.js generated vendored Normal file
View File

@@ -0,0 +1,46 @@
var test = require('tape');
var fs = require('fs');
var slice = require('./index').slice;
var bufferReady = fs.readFileSync('./README.md');
test('normal test', function(t) {
var chunks = [];
fs.createReadStream('./README.md')
.pipe(slice(0, 10))
.on('data', chunks.push.bind(chunks))
.on('end', function() {
var res = Buffer.concat(chunks);
t.equal(res.length, 10);
t.equal(bufferEq(res, bufferReady.slice(0, 10)), true);
t.end();
});
});
test('normal test', function(t) {
var chunks = [];
fs.createReadStream('./README.md')
.pipe(slice(10, 20))
.on('data', chunks.push.bind(chunks))
.on('end', function() {
var res = Buffer.concat(chunks);
t.equal(res.length, 10);
t.equal(bufferEq(res, bufferReady.slice(10, 20)), true);
t.end();
});
});
function bufferEq(foo, bar) {
if (!Buffer.isBuffer(foo) || !Buffer.isBuffer(bar)) {
throw new TypeError('Arguments must be a buffer');
}
if (foo.length !== bar.length) {
return false;
}
for (var i = 0; i < foo.length; i++) {
if (foo[i] !== bar[i]) {
return false;
}
}
return true;
}