https://github.com/jamen/vinyl-write
Write vinyl objects to the file system
https://github.com/jamen/vinyl-write
Last synced: about 1 year ago
JSON representation
Write vinyl objects to the file system
- Host: GitHub
- URL: https://github.com/jamen/vinyl-write
- Owner: jamen
- License: mit
- Created: 2016-03-29T23:34:54.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-24T14:06:07.000Z (over 9 years ago)
- Last Synced: 2024-04-24T17:41:42.015Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vinyl-write [](https://npmjs.org/package/vinyl-write) [](https://travis-ci.org/jamen/vinyl-write)
> Write vinyl objects to the file system
```javascript
const write = require('vinyl-write')
const Vinyl = require('vinyl')
// Get a `Vinyl` object somehow
const file = new Vinyl({ ...options })
// Write it
write(file, function (err) {
if (err) console.error(err)
})
```
## Installation
```shell
$ npm install --save vinyl-write
```
## Usage
### `write(file, [callback])`
Writes a [`Vinyl`](https://github.com/gulpjs/vinyl) object to the file system, with a completion callback.
- `file` (`Vinyl`): Vinyl object you are writing.
- `callback` (`function`): Optional completion callback.
The callback receives `(err)` as parameter.
```javascript
write(file, function (err) {
// ...
})
```
## License
[MIT](LICENSE) © Jamen Marzonie