https://github.com/floatdrop/vinyl-git
Vinyl adapter for working with git
https://github.com/floatdrop/vinyl-git
Last synced: 10 months ago
JSON representation
Vinyl adapter for working with git
- Host: GitHub
- URL: https://github.com/floatdrop/vinyl-git
- Owner: floatdrop
- Created: 2014-07-29T09:04:55.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-10-29T18:26:48.000Z (over 11 years ago)
- Last Synced: 2025-03-14T01:31:43.789Z (about 1 year ago)
- Language: JavaScript
- Size: 238 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# vinyl-git [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]
Get files as Vinyl File objects from git.
## Why
Use it with [`husky`](https://github.com/typicode/husky). There are plenty projects, that are in terrible state, because of lacking of linting in development process. To get linting (and codestyle checks) in such kind of project and not be overwhelmed with linting errors from legacy code `vinyl-git` was created.
Just replace `gulp.src` with `git.staged` and run linting on only files, that are prepeared for commiting (just do not forget to add precommit hook with, [`husky`](https://github.com/typicode/husky)).
## Usage
```js
var map = require('map-stream');
var git = require('vinyl-git');
var log = function(file, cb) {
console.log(file.path);
cb(null, file);
};
git.staged()
.pipe(map(log))
.pipe(fs.dest('./output'));
```
## API
### staged([options])
Returns stream with currently staged files. Options are same as in [`vinyl-fs` src method](https://github.com/wearefractal/vinyl-fs#srcglobs-opt).
# License
MIT (c) 2014 Vsevolod Strukchinsky (floatdrop@gmail.com)
[npm-url]: https://npmjs.org/package/vinyl-git
[npm-image]: http://img.shields.io/npm/v/vinyl-git.svg
[travis-url]: https://travis-ci.org/floatdrop/vinyl-git
[travis-image]: http://img.shields.io/travis/floatdrop/vinyl-git.svg
[depstat-url]: https://david-dm.org/floatdrop/vinyl-git
[depstat-image]: https://david-dm.org/floatdrop/vinyl-git.svg?theme=shields.io