Initial
This commit is contained in:
21
Client/node_modules/vinyl-source-stream/LICENSE.md
generated
vendored
Executable file
21
Client/node_modules/vinyl-source-stream/LICENSE.md
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
## The MIT License (MIT) ##
|
||||
|
||||
Copyright (c) 2014 Hugh Kennedy
|
||||
|
||||
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.
|
||||
75
Client/node_modules/vinyl-source-stream/README.md
generated
vendored
Executable file
75
Client/node_modules/vinyl-source-stream/README.md
generated
vendored
Executable file
@@ -0,0 +1,75 @@
|
||||
# vinyl-source-stream [](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/vinyl-source-stream&title=vinyl-source-stream&description=hughsk/vinyl-source-stream%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[](http://github.com/hughsk/stability-badges) #
|
||||
|
||||
Use conventional text streams at the start of your
|
||||
[gulp](http://github.com/gulpjs/gulp) or
|
||||
[vinyl](http://github.com/wearefractal/vinyl) pipelines, making for nicer
|
||||
interoperability with the existing npm stream ecosystem.
|
||||
|
||||
Take, for example, [browserify](http://browserify.org/). There are the
|
||||
[gulp-browserify](https://github.com/deepak1556/gulp-browserify) and
|
||||
[gulpify](https://github.com/hughsk/gulpify) plugins, which you can use in
|
||||
combination with gulp to get browserify working in your build. Unfortunately,
|
||||
these plugins come with additional overhead: an extra GitHub repository, npm
|
||||
module, maintainer, tests, semantics, etc. It's much simpler
|
||||
in this case to use the original module directly where you can, which is what
|
||||
`vinyl-source-stream` handles for you.
|
||||
|
||||
## Usage ##
|
||||
|
||||
[](https://nodei.co/npm/vinyl-source-stream)
|
||||
|
||||
Our previous example, browserify, has a streaming API for its output bundles
|
||||
which you can use directly. This module is just a bridge that makes it
|
||||
simple to use conventional text streams such as this in combination with gulp.
|
||||
Here's an example of using `vinyl-source-stream` and `browserify`, compared to
|
||||
using `gulpify`:
|
||||
|
||||
``` javascript
|
||||
var source = require('vinyl-source-stream')
|
||||
var streamify = require('gulp-streamify')
|
||||
var browserify = require('browserify')
|
||||
var uglify = require('gulp-uglify')
|
||||
var gulpify = require('gulpify')
|
||||
var rename = require('gulp-rename')
|
||||
var gulp = require('gulp')
|
||||
|
||||
// using gulpify:
|
||||
gulp.task('gulpify', function() {
|
||||
gulp.src('index.js')
|
||||
.pipe(gulpify())
|
||||
.pipe(uglify())
|
||||
.pipe(rename('bundle.js'))
|
||||
.pipe(gulp.dest('./'))
|
||||
})
|
||||
|
||||
// using vinyl-source-stream:
|
||||
gulp.task('browserify', function() {
|
||||
var bundleStream = browserify('./index.js').bundle()
|
||||
|
||||
bundleStream
|
||||
.pipe(source('index.js'))
|
||||
.pipe(streamify(uglify()))
|
||||
.pipe(rename('bundle.js'))
|
||||
.pipe(gulp.dest('./'))
|
||||
})
|
||||
```
|
||||
|
||||
Not all that different, really! The nice thing here is that you're getting the
|
||||
up-to-date browserify API and don't have to worry about the plugin's available
|
||||
functionality. Of course, these same benefits apply for any readable text
|
||||
stream you can find on npm.
|
||||
|
||||
## API ##
|
||||
|
||||
### `stream = sourceStream([filename])` ###
|
||||
|
||||
Creates a through stream which takes text as input, and emits a single
|
||||
vinyl file instance for streams down the pipeline to consume.
|
||||
|
||||
`filename` is a "pretend" filename to use for your file, which some streams
|
||||
might use to determine various factors such as the final filename of your file.
|
||||
It should be a string, and though recommended, using this argument is optional.
|
||||
|
||||
## License ##
|
||||
|
||||
MIT. See [LICENSE.md](http://github.com/hughsk/vinyl-source-stream/blob/master/LICENSE.md) for details.
|
||||
32
Client/node_modules/vinyl-source-stream/index.js
generated
vendored
Executable file
32
Client/node_modules/vinyl-source-stream/index.js
generated
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
var through2 = require('through2')
|
||||
var File = require('vinyl')
|
||||
var path = require('path')
|
||||
|
||||
module.exports = function (filename, baseDir) {
|
||||
var ins = through2()
|
||||
var out = false
|
||||
|
||||
var opts = {
|
||||
contents: ins
|
||||
}
|
||||
|
||||
if (filename) opts.path = path.resolve(baseDir || process.cwd(), filename)
|
||||
if (baseDir) opts.base = baseDir
|
||||
|
||||
var file = new File(opts)
|
||||
|
||||
return through2({
|
||||
objectMode: true
|
||||
}, function(chunk, enc, next) {
|
||||
if (!out) {
|
||||
this.push(file)
|
||||
out = true
|
||||
}
|
||||
|
||||
ins.push(chunk)
|
||||
next()
|
||||
}, function() {
|
||||
ins.push(null)
|
||||
this.push(null)
|
||||
})
|
||||
}
|
||||
69
Client/node_modules/vinyl-source-stream/package.json
generated
vendored
Executable file
69
Client/node_modules/vinyl-source-stream/package.json
generated
vendored
Executable file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"_from": "vinyl-source-stream@^1.1.0",
|
||||
"_id": "vinyl-source-stream@1.1.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-YrU6E1YQqJbpjKlr7jqH8Aio54A=",
|
||||
"_location": "/vinyl-source-stream",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "vinyl-source-stream@^1.1.0",
|
||||
"name": "vinyl-source-stream",
|
||||
"escapedName": "vinyl-source-stream",
|
||||
"rawSpec": "^1.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/vscode"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-1.1.2.tgz",
|
||||
"_shasum": "62b53a135610a896e98ca96bee3a87f008a8e780",
|
||||
"_spec": "vinyl-source-stream@^1.1.0",
|
||||
"_where": "/home/nathan/Projects/Upsilon/UpsilonVsCodeLanguageServer/Client/node_modules/vscode",
|
||||
"author": {
|
||||
"name": "Hugh Kennedy",
|
||||
"email": "hughskennedy@gmail.com",
|
||||
"url": "http://hughsk.io/"
|
||||
},
|
||||
"browser": "index.js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/hughsk/vinyl-source-stream/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"through2": "^2.0.3",
|
||||
"vinyl": "^0.4.3"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Use conventional text streams at the start of your gulp or vinyl pipelines",
|
||||
"devDependencies": {
|
||||
"gulp": "~3.3.0",
|
||||
"gulp-rename": "~0.2.1",
|
||||
"tape": "~2.3.2",
|
||||
"vinyl-map": "0.0.1"
|
||||
},
|
||||
"homepage": "https://github.com/hughsk/vinyl-source-stream",
|
||||
"keywords": [
|
||||
"vinyl",
|
||||
"gulp",
|
||||
"gulpfriendly",
|
||||
"vanilla",
|
||||
"stream",
|
||||
"string",
|
||||
"text",
|
||||
"classic"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "vinyl-source-stream",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/hughsk/vinyl-source-stream.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test"
|
||||
},
|
||||
"version": "1.1.2"
|
||||
}
|
||||
48
Client/node_modules/vinyl-source-stream/test.js
generated
vendored
Executable file
48
Client/node_modules/vinyl-source-stream/test.js
generated
vendored
Executable file
@@ -0,0 +1,48 @@
|
||||
var rename = require('gulp-rename')
|
||||
var map = require('vinyl-map')
|
||||
var srcStream = require('./')
|
||||
var gulp = require('gulp')
|
||||
var test = require('tape')
|
||||
var path = require('path')
|
||||
var fs = require('fs')
|
||||
|
||||
test('capitalizing test file', function(t) {
|
||||
fs.createReadStream(__filename)
|
||||
.pipe(srcStream(__filename))
|
||||
.pipe(map(function(str) {
|
||||
return str.toString().toUpperCase()
|
||||
}))
|
||||
.pipe(rename("fixture.js"))
|
||||
.pipe(gulp.dest('.'))
|
||||
.once('end', function() {
|
||||
// gulp.dest finishes before writing
|
||||
// the file is complete...
|
||||
setTimeout(function() {
|
||||
t.pass('reached pipline "end" event')
|
||||
t.equal(
|
||||
fs.readFileSync(__dirname + '/fixture.js', 'utf8')
|
||||
, fs.readFileSync(__filename, 'utf8').toUpperCase()
|
||||
, 'transformed contents as expected'
|
||||
)
|
||||
|
||||
fs.unlink(__dirname + '/fixture.js', function(err) {
|
||||
t.ifError(err, 'removed fixture successfully')
|
||||
t.end()
|
||||
})
|
||||
}, 1500)
|
||||
})
|
||||
})
|
||||
|
||||
test('baseDir: defaults to process.cwd()', function(t) {
|
||||
process.chdir(path.resolve(__dirname, '..', '..'))
|
||||
|
||||
fs.createReadStream(__filename)
|
||||
.pipe(srcStream(path.basename(__filename)))
|
||||
.on('data', function(file) {
|
||||
t.equal(process.cwd(), path.dirname(file.path), 'defaults to process.cwd()')
|
||||
|
||||
process.chdir(__dirname)
|
||||
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user