Fix actions/tour
This commit is contained in:
21
node_modules/vinyl-contents/LICENSE
generated
vendored
Normal file
21
node_modules/vinyl-contents/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019, 2022 Blaine Bublitz <blaine.bublitz@gmail.com> and Eric Schoffstall <yo@contra.io>
|
||||
|
||||
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.
|
||||
73
node_modules/vinyl-contents/README.md
generated
vendored
Normal file
73
node_modules/vinyl-contents/README.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
<p align="center">
|
||||
<a href="http://gulpjs.com">
|
||||
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# vinyl-contents
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]
|
||||
|
||||
Utility to read the contents of a vinyl file.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
/*
|
||||
WARNING: This is a very naive plugin implementation
|
||||
It is only meant for demonstation purposes.
|
||||
For a more complete implementation, see: https://github.com/gulp-community/gulp-pug
|
||||
*/
|
||||
var { Transform } = require('streamx');
|
||||
var pug = require('pug');
|
||||
var vinylContents = require('vinyl-contents');
|
||||
|
||||
function gulpPug(options) {
|
||||
return new Transform({
|
||||
transform: function (file, cb) {
|
||||
vinylContents(file, function (err, contents) {
|
||||
if (err) {
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
if (!contents) {
|
||||
return cb();
|
||||
}
|
||||
|
||||
file.contents = pug.compile(contents.toString(), options)();
|
||||
cb(null, file);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `vinylContents(file, callback)`
|
||||
|
||||
**Warning:** Only use this if interacting with a library that can **only** receive strings or buffers. This loads all streaming contents into memory which can cause unexpected results for your end-users.
|
||||
|
||||
Takes a Vinyl file and an error-first callback. Calls the callback with an error if one occur (or if the first argument is not a Vinyl file), or the file contents if no error occurs.
|
||||
|
||||
If the Vinyl contents are:
|
||||
|
||||
- A Buffer, will be returned directly.
|
||||
- A Stream, will be buffered into a BufferList and returned.
|
||||
- Empty, will be undefined.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
[downloads-image]: https://img.shields.io/npm/dm/vinyl-contents.svg?style=flat-square
|
||||
[npm-url]: https://www.npmjs.com/package/vinyl-contents
|
||||
[npm-image]: https://img.shields.io/npm/v/vinyl-contents.svg?style=flat-square
|
||||
|
||||
[ci-url]: https://github.com/gulpjs/vinyl-contents/actions?query=workflow:dev
|
||||
[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/vinyl-contents/dev?style=flat-square
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/gulpjs/vinyl-contents
|
||||
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/vinyl-contents/master.svg?style=flat-square
|
||||
<!-- prettier-ignore-end -->
|
||||
33
node_modules/vinyl-contents/index.js
generated
vendored
Normal file
33
node_modules/vinyl-contents/index.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
var Vinyl = require('vinyl');
|
||||
var bl = require('bl');
|
||||
|
||||
function vinylContents(file, cb) {
|
||||
if (!Vinyl.isVinyl(file)) {
|
||||
cb(new Error('Must be a Vinyl object'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.isBuffer()) {
|
||||
cb(null, file.contents);
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.isStream()) {
|
||||
var bufferList = bl(function (err, data) {
|
||||
if (err) {
|
||||
cb(err);
|
||||
return;
|
||||
}
|
||||
|
||||
cb(null, data);
|
||||
});
|
||||
file.contents.pipe(bufferList);
|
||||
return;
|
||||
}
|
||||
|
||||
cb();
|
||||
}
|
||||
|
||||
module.exports = vinylContents;
|
||||
48
node_modules/vinyl-contents/package.json
generated
vendored
Normal file
48
node_modules/vinyl-contents/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "vinyl-contents",
|
||||
"version": "2.0.0",
|
||||
"description": "Utility to read the contents of a vinyl file.",
|
||||
"author": "Gulp Team <team@gulpjs.com> (https://gulpjs.com/)",
|
||||
"contributors": [
|
||||
"Blaine Bublitz <blaine.bublitz@gmail.com>"
|
||||
],
|
||||
"repository": "gulpjs/vinyl-contents",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
},
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"pretest": "npm run lint",
|
||||
"test": "nyc mocha --async-only"
|
||||
},
|
||||
"dependencies": {
|
||||
"bl": "^5.0.0",
|
||||
"vinyl": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^7.0.0",
|
||||
"eslint-config-gulp": "^5.0.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"expect": "^27.0.0",
|
||||
"mocha": "^8.0.0",
|
||||
"nyc": "^15.0.0",
|
||||
"readable-stream": "^3.6.0",
|
||||
"streamx": "^2.12.5"
|
||||
},
|
||||
"nyc": {
|
||||
"reporter": [
|
||||
"lcov",
|
||||
"text-summary"
|
||||
]
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true
|
||||
},
|
||||
"keywords": []
|
||||
}
|
||||
Reference in New Issue
Block a user