UNPKG

motion

Version:

motion - moving development forward

97 lines (96 loc) 6.42 kB
{ "_args": [ [ "vinyl-fs@https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", "/Users/nw/flint/packages/flint" ] ], "_from": "vinyl-fs@>=0.3.0 <0.4.0", "_id": "vinyl-fs@0.3.14", "_inCache": true, "_location": "/vinyl-fs", "_phantomChildren": { "clone-stats": "0.0.1", "core-util-is": "1.0.2", "first-chunk-stream": "1.0.0", "inherits": "2.0.1", "is-utf8": "0.2.1", "isarray": "0.0.1", "string_decoder": "0.10.31", "xtend": "4.0.1" }, "_requested": { "name": "vinyl-fs", "raw": "vinyl-fs@https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", "rawSpec": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", "scope": null, "spec": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", "type": "remote" }, "_requiredBy": [ "/gulp" ], "_resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", "_shasum": "9a6851ce1cac1c1cea5fe86c0931d620c2cfa9e6", "_shrinkwrap": null, "_spec": "vinyl-fs@https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", "_where": "/Users/nw/flint/packages/flint", "author": { "email": "contact@wearefractal.com", "name": "Fractal", "url": "http://wearefractal.com/" }, "bugs": { "url": "https://github.com/wearefractal/vinyl-fs/issues" }, "dependencies": { "defaults": "^1.0.0", "glob-stream": "^3.1.5", "glob-watcher": "^0.0.6", "graceful-fs": "^3.0.0", "mkdirp": "^0.5.0", "strip-bom": "^1.0.0", "through2": "^0.6.1", "vinyl": "^0.4.0" }, "description": "Vinyl adapter for the file system", "devDependencies": { "buffer-equal": "^0.0.1", "coveralls": "^2.6.1", "istanbul": "^0.3.0", "jshint": "^2.4.1", "mocha": "^2.0.0", "mocha-lcov-reporter": "^0.0.1", "rimraf": "^2.2.5", "should": "^4.0.0", "sinon": "^1.10.3" }, "engines": { "node": ">= 0.10" }, "files": [ "index.js", "lib" ], "homepage": "http://github.com/wearefractal/vinyl-fs", "licenses": [ { "type": "MIT", "url": "http://github.com/wearefractal/vinyl-fs/raw/master/LICENSE" } ], "main": "./index.js", "name": "vinyl-fs", "optionalDependencies": {}, "readme": "# vinyl-fs [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status](https://david-dm.org/wearefractal/vinyl.png?theme=shields.io)](https://david-dm.org/wearefractal/vinyl-fs)\n\n## Information\n\n<table>\n<tr>\n<td>Package</td><td>vinyl-fs</td>\n</tr>\n<tr>\n<td>Description</td>\n<td>Vinyl adapter for the file system</td>\n</tr>\n<tr>\n<td>Node Version</td>\n<td>>= 0.10</td>\n</tr>\n</table>\n\n## Usage\n\n```javascript\nvar map = require('map-stream');\nvar fs = require('vinyl-fs');\n\nvar log = function(file, cb) {\n console.log(file.path);\n cb(null, file);\n};\n\nfs.src(['./js/**/*.js', '!./js/vendor/*.js'])\n .pipe(map(log))\n .pipe(fs.dest('./output'));\n```\n\n## API\n\n### src(globs[, opt])\n\n- Takes a glob string or an array of glob strings as the first argument.\n- Possible options for the second argument:\n - cwd - Specify the working directory the folder is relative to. Default is `process.cwd()`\n - base - Specify the folder relative to the cwd. Default is where the glob begins. This is used to determine the file names when saving in `.dest()`\n - buffer - `true` or `false` if you want to buffer the file.\n - Default value is `true`\n - `false` will make file.contents a paused Stream\n - read - `true` or `false` if you want the file to be read or not. Useful for stuff like `rm`ing files.\n - Default value is `true`\n - `false` will disable writing the file to disk via `.dest()`\n - Any glob-related options are documented in [glob-stream] and [node-glob]\n- Returns a Readable/Writable stream.\n- On write the stream will simply pass items through.\n- This stream emits matching [vinyl] File objects\n\n### watch(globs[, opt, cb])\n\nThis is just [glob-watcher]\n\n- Takes a glob string or an array of glob strings as the first argument.\n- Possible options for the second argument:\n - Any options are passed to [gaze]\n- Returns an EventEmitter\n - 'changed' event is emitted on each file change\n- Optionally calls the callback on each change event\n\n### dest(folder[, opt])\n\n- Takes a folder path as the first argument.\n- First argument can also be a function that takes in a file and returns a folder path.\n- Possible options for the second argument:\n - cwd - Specify the working directory the folder is relative to. Default is `process.cwd()`\n - mode - Specify the mode the files should be created with. Default is the mode of the input file (file.stat.mode)\n- Returns a Readable/Writable stream.\n- On write the stream will save the [vinyl] File to disk at the folder/cwd specified.\n- After writing the file to disk, it will be emitted from the stream so you can keep piping these around\n- The file will be modified after being written to this stream\n - `cwd`, `base`, and `path` will be overwritten to match the folder\n - `stat.mode` will be overwritten if you used a mode parameter\n - `contents` will have it's position reset to the beginning if it is a stream\n\n[glob-stream]: https://github.com/wearefractal/glob-stream\n[node-glob]: https://github.com/isaacs/node-glob\n[gaze]: https://github.com/shama/gaze\n[glob-watcher]: https://github.com/wearefractal/glob-watcher\n[vinyl]: https://github.com/wearefractal/vinyl\n\n[npm-url]: https://npmjs.org/package/vinyl-fs\n[npm-image]: https://badge.fury.io/js/vinyl-fs.png\n[travis-url]: https://travis-ci.org/wearefractal/vinyl-fs\n[travis-image]: https://travis-ci.org/wearefractal/vinyl-fs.png?branch=master\n[coveralls-url]: https://coveralls.io/r/wearefractal/vinyl-fs\n[coveralls-image]: https://coveralls.io/repos/wearefractal/vinyl-fs/badge.png\n[depstat-url]: https://david-dm.org/wearefractal/vinyl-fs\n[depstat-image]: https://david-dm.org/wearefractal/vinyl-fs.png\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git://github.com/wearefractal/vinyl-fs.git" }, "scripts": { "coveralls": "istanbul cover _mocha -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage", "test": "mocha --reporter spec && jshint lib" }, "version": "0.3.14" }