Added Gulp.js for compiling SCSS stylesheets
This commit is contained in:
6
node_modules/flush-write-stream/.travis.yml
generated
vendored
Normal file
6
node_modules/flush-write-stream/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- '4'
|
||||
- '6'
|
||||
- '8'
|
||||
- '10'
|
21
node_modules/flush-write-stream/LICENSE
generated
vendored
Normal file
21
node_modules/flush-write-stream/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Mathias Buus
|
||||
|
||||
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.
|
59
node_modules/flush-write-stream/README.md
generated
vendored
Normal file
59
node_modules/flush-write-stream/README.md
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
# flush-write-stream
|
||||
|
||||
A write stream constructor that supports a flush function that is called before `finish` is emitted
|
||||
|
||||
```
|
||||
npm install flush-write-stream
|
||||
```
|
||||
|
||||
[](http://travis-ci.org/mafintosh/flush-write-stream)
|
||||
|
||||
## Usage
|
||||
|
||||
``` js
|
||||
var writer = require('flush-write-stream')
|
||||
|
||||
var ws = writer(write, flush)
|
||||
|
||||
ws.on('finish', function () {
|
||||
console.log('finished')
|
||||
})
|
||||
|
||||
ws.write('hello')
|
||||
ws.write('world')
|
||||
ws.end()
|
||||
|
||||
function write (data, enc, cb) {
|
||||
// i am your normal ._write method
|
||||
console.log('writing', data.toString())
|
||||
cb()
|
||||
}
|
||||
|
||||
function flush (cb) {
|
||||
// i am called before finish is emitted
|
||||
setTimeout(cb, 1000) // wait 1 sec
|
||||
}
|
||||
```
|
||||
|
||||
If you run the above it will produce the following output
|
||||
|
||||
```
|
||||
writing hello
|
||||
writing world
|
||||
(nothing happens for 1 sec)
|
||||
finished
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
#### `var ws = writer([options], write, [flush])`
|
||||
|
||||
Create a new writable stream. Options are forwarded to the stream constructor.
|
||||
|
||||
#### `var ws = writer.obj([options], write, [flush])`
|
||||
|
||||
Same as the above except `objectMode` is set to `true` per default.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
22
node_modules/flush-write-stream/example.js
generated
vendored
Normal file
22
node_modules/flush-write-stream/example.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
var writer = require('./')
|
||||
|
||||
var ws = writer(write, flush)
|
||||
|
||||
ws.on('finish', function () {
|
||||
console.log('finished')
|
||||
})
|
||||
|
||||
ws.write('hello')
|
||||
ws.write('world')
|
||||
ws.end()
|
||||
|
||||
function write (data, enc, cb) {
|
||||
// i am your normal ._write method
|
||||
console.log('writing', data.toString())
|
||||
cb()
|
||||
}
|
||||
|
||||
function flush (cb) {
|
||||
// i am called before finish is emitted
|
||||
setTimeout(cb, 1000) // wait 1 sec
|
||||
}
|
54
node_modules/flush-write-stream/index.js
generated
vendored
Normal file
54
node_modules/flush-write-stream/index.js
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
var stream = require('readable-stream')
|
||||
var inherits = require('inherits')
|
||||
|
||||
var SIGNAL_FLUSH =(Buffer.from && Buffer.from !== Uint8Array.from)
|
||||
? Buffer.from([0])
|
||||
: new Buffer([0])
|
||||
|
||||
module.exports = WriteStream
|
||||
|
||||
function WriteStream (opts, write, flush) {
|
||||
if (!(this instanceof WriteStream)) return new WriteStream(opts, write, flush)
|
||||
|
||||
if (typeof opts === 'function') {
|
||||
flush = write
|
||||
write = opts
|
||||
opts = {}
|
||||
}
|
||||
|
||||
stream.Writable.call(this, opts)
|
||||
|
||||
this.destroyed = false
|
||||
this._worker = write || null
|
||||
this._flush = flush || null
|
||||
}
|
||||
|
||||
inherits(WriteStream, stream.Writable)
|
||||
|
||||
WriteStream.obj = function (opts, worker, flush) {
|
||||
if (typeof opts === 'function') return WriteStream.obj(null, opts, worker)
|
||||
if (!opts) opts = {}
|
||||
opts.objectMode = true
|
||||
return new WriteStream(opts, worker, flush)
|
||||
}
|
||||
|
||||
WriteStream.prototype._write = function (data, enc, cb) {
|
||||
if (SIGNAL_FLUSH === data) this._flush(cb)
|
||||
else this._worker(data, enc, cb)
|
||||
}
|
||||
|
||||
WriteStream.prototype.end = function (data, enc, cb) {
|
||||
if (!this._flush) return stream.Writable.prototype.end.apply(this, arguments)
|
||||
if (typeof data === 'function') return this.end(null, null, data)
|
||||
if (typeof enc === 'function') return this.end(data, null, enc)
|
||||
if (data) this.write(data)
|
||||
if (!this._writableState.ending) this.write(SIGNAL_FLUSH)
|
||||
return stream.Writable.prototype.end.call(this, cb)
|
||||
}
|
||||
|
||||
WriteStream.prototype.destroy = function (err) {
|
||||
if (this.destroyed) return
|
||||
this.destroyed = true
|
||||
if (err) this.emit('error', err)
|
||||
this.emit('close')
|
||||
}
|
26
node_modules/flush-write-stream/package.json
generated
vendored
Normal file
26
node_modules/flush-write-stream/package.json
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "flush-write-stream",
|
||||
"version": "1.1.1",
|
||||
"description": "A write stream constructor that supports a flush function that is called before finish is emitted",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"readable-stream": "^2.3.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tape": "^4.2.2"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape test.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mafintosh/flush-write-stream.git"
|
||||
},
|
||||
"author": "Mathias Buus (@mafintosh)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/mafintosh/flush-write-stream/issues"
|
||||
},
|
||||
"homepage": "https://github.com/mafintosh/flush-write-stream"
|
||||
}
|
85
node_modules/flush-write-stream/test.js
generated
vendored
Normal file
85
node_modules/flush-write-stream/test.js
generated
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
var tape = require('tape')
|
||||
var writer = require('./')
|
||||
|
||||
tape('is a write stream', function (t) {
|
||||
var expected = ['hello', 'world', 'verden']
|
||||
var ws = writer.obj(write)
|
||||
|
||||
ws.write('hello')
|
||||
ws.write('world')
|
||||
ws.write('verden')
|
||||
ws.end(function () {
|
||||
t.same(expected.length, 0)
|
||||
t.end()
|
||||
})
|
||||
|
||||
function write (data, enc, cb) {
|
||||
t.same(data, expected.shift())
|
||||
cb()
|
||||
}
|
||||
})
|
||||
|
||||
tape('is flushable', function (t) {
|
||||
var expected = ['hello', 'world', 'verden']
|
||||
var flushed = false
|
||||
|
||||
var ws = writer.obj(write, flush)
|
||||
|
||||
ws.write('hello')
|
||||
ws.write('world')
|
||||
ws.write('verden')
|
||||
ws.end(function () {
|
||||
t.same(expected.length, 0)
|
||||
t.ok(flushed, 'was flushed')
|
||||
t.end()
|
||||
})
|
||||
|
||||
function write (data, enc, cb) {
|
||||
t.same(data, expected.shift())
|
||||
cb()
|
||||
}
|
||||
|
||||
function flush (cb) {
|
||||
flushed = true
|
||||
process.nextTick(cb)
|
||||
}
|
||||
})
|
||||
|
||||
tape('can pass options', function (t) {
|
||||
var expected = ['hello', 'world', 'verden']
|
||||
var flushed = false
|
||||
|
||||
var ws = writer({objectMode: true}, write, flush)
|
||||
|
||||
ws.write('hello')
|
||||
ws.write('world')
|
||||
ws.write('verden')
|
||||
ws.end(function () {
|
||||
t.same(expected.length, 0)
|
||||
t.ok(flushed, 'was flushed')
|
||||
t.end()
|
||||
})
|
||||
|
||||
function write (data, enc, cb) {
|
||||
t.same(data, expected.shift())
|
||||
cb()
|
||||
}
|
||||
|
||||
function flush (cb) {
|
||||
flushed = true
|
||||
process.nextTick(cb)
|
||||
}
|
||||
})
|
||||
|
||||
tape('emits error on destroy', function (t) {
|
||||
var expected = new Error()
|
||||
|
||||
var ws = writer({objectMode: true}, function () {})
|
||||
|
||||
ws.on('error', function (err) {
|
||||
t.equal(err, expected)
|
||||
})
|
||||
ws.on('close', t.end)
|
||||
|
||||
ws.destroy(expected)
|
||||
})
|
Reference in New Issue
Block a user