mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
New updates and modules
This commit is contained in:
parent
4d5d408898
commit
0abf0f90f6
959 changed files with 364301 additions and 17493 deletions
3
node_modules/level-write-stream/.npmignore
generated
vendored
Normal file
3
node_modules/level-write-stream/.npmignore
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
node_modules
|
||||
*.log
|
||||
*.err
|
19
node_modules/level-write-stream/LICENCE
generated
vendored
Normal file
19
node_modules/level-write-stream/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.
|
35
node_modules/level-write-stream/README.md
generated
vendored
Normal file
35
node_modules/level-write-stream/README.md
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
# level-write-stream
|
||||
|
||||
A writeStream implementation for leveldb
|
||||
|
||||
## Example
|
||||
|
||||
This implements the writeStream logic for a levelup interface.
|
||||
|
||||
Just pass it a db with `put` and `batch` method and it will do
|
||||
the rest!
|
||||
|
||||
```js
|
||||
var LevelWriteStream = require("level-write-stream")
|
||||
|
||||
var db = someleveldb()
|
||||
|
||||
var writeStream = LevelWriteStream(db)
|
||||
|
||||
var stream = writeStream(options)
|
||||
|
||||
stream.write({
|
||||
key: key
|
||||
, value: value
|
||||
})
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
`npm install level-write-stream`
|
||||
|
||||
## Contributors
|
||||
|
||||
- Raynos
|
||||
|
||||
## MIT Licenced
|
45
node_modules/level-write-stream/index.js
generated
vendored
Normal file
45
node_modules/level-write-stream/index.js
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
var EndStream = require("end-stream")
|
||||
|
||||
module.exports = LevelWriteStream
|
||||
|
||||
function LevelWriteStream(db) {
|
||||
return writeStream
|
||||
|
||||
function writeStream(options) {
|
||||
options = options || {}
|
||||
|
||||
var queue = []
|
||||
, stream = EndStream(write)
|
||||
|
||||
return stream
|
||||
|
||||
function write(chunk, callback) {
|
||||
if (queue.length === 0) {
|
||||
process.nextTick(drain)
|
||||
}
|
||||
|
||||
queue.push(chunk)
|
||||
stream.once("_drain", callback)
|
||||
}
|
||||
|
||||
function drain() {
|
||||
if (queue.length === 1) {
|
||||
var chunk = queue[0]
|
||||
db.put(chunk.key, chunk.value, options, emit)
|
||||
} else {
|
||||
var arr = queue.map(function (chunk) {
|
||||
chunk.type = "put"
|
||||
return chunk
|
||||
})
|
||||
|
||||
db.batch(arr, options, emit)
|
||||
}
|
||||
|
||||
queue.length = 0
|
||||
}
|
||||
|
||||
function emit(err) {
|
||||
stream.emit("_drain", err)
|
||||
}
|
||||
}
|
||||
}
|
34
node_modules/level-write-stream/package.json
generated
vendored
Normal file
34
node_modules/level-write-stream/package.json
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"name": "level-write-stream",
|
||||
"version": "1.0.0",
|
||||
"description": "A writeStream implementation for leveldb",
|
||||
"keywords": [],
|
||||
"author": "Raynos <raynos2@gmail.com>",
|
||||
"repository": "git://github.com/Raynos/level-write-stream.git",
|
||||
"main": "index",
|
||||
"homepage": "https://github.com/Raynos/level-write-stream",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jake Verbaten"
|
||||
}
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/Raynos/level-write-stream/issues",
|
||||
"email": "raynos2@gmail.com"
|
||||
},
|
||||
"dependencies": {
|
||||
"end-stream": "~0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tap": "~0.3.1"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://github.com/Raynos/level-write-stream/raw/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"scripts": {
|
||||
"test": "tap --stderr --tap ./test"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue