# vinyl
**Repository Path**: mirrors_floatdrop/vinyl
## Basic Information
- **Project Name**: vinyl
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-09-24
- **Last Updated**: 2026-05-17
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
[](https://travis-ci.org/wearefractal/vinyl)
[](http://badge.fury.io/js/vinyl)
## Information
| Package | vinyl |
| Description |
A virtual file format |
| Node Version |
>= 0.9 |
## File
```javascript
var File = require('vinyl');
var coffeeFile = new File({
cwd: "/",
base: "/test/",
path: "/test/file.coffee"
contents: new Buffer("test = 123")
});
```
### constructor(options)
#### options.cwd
Type: `String`
Default: `process.cwd()`
#### options.base
Used for relative pathing. Typically where a glob starts.
Type: `String`
Default: `options.cwd`
#### options.path
Full path to the file.
Type: `String`
Default: `null`
#### options.stat
The result of an fs.stat call. See [fs.Stats](http://nodejs.org/api/fs.html#fs_class_fs_stats) for more information.
Type: `fs.Stats`
Default: `null`
#### options.contents
File contents.
Type: `Buffer, Stream, or null`
Default: `null`
### isBuffer()
Returns true if file.contents is a Buffer.
### isStream()
Returns true if file.contents is a Stream.
### isNull()
Returns true if file.contents is null.
### clone()
Returns a new File object with all attributes cloned.
### pipe(stream[, opt])
If file.contents is a Buffer, it will write it to the stream.
If file.contents is a Stream, it will pipe it to the stream.
If file.contents is null, it will do nothing.
If opt.end is true, the destination stream will not be ended (same as node core).
Returns the stream.
### inspect()
Returns a pretty String interpretation of the File. Useful for console.log.
### relative
Returns path.relative for the file base and file path.
Example:
```javascript
var file = new File({
cwd: "/",
base: "/test/",
path: "/test/file.coffee"
});
console.log(file.relative); // file.coffee
```
## LICENSE
(MIT License)
Copyright (c) 2013 Fractal
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.