Added Gulp.js for compiling SCSS stylesheets
This commit is contained in:
21
node_modules/fs-mkdirp-stream/LICENSE
generated
vendored
Normal file
21
node_modules/fs-mkdirp-stream/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors (Originally based on code from node-mkdirp - MIT/X11 license - Copyright 2010 James Halliday)
|
||||
|
||||
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.
|
65
node_modules/fs-mkdirp-stream/README.md
generated
vendored
Normal file
65
node_modules/fs-mkdirp-stream/README.md
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
<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>
|
||||
|
||||
# fs-mkdirp-stream
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
|
||||
|
||||
Ensure directories exist before writing to them.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var to = require('to2');
|
||||
var from = require('from2');
|
||||
var mkdirpStream = require('fs-mkdirp-stream');
|
||||
|
||||
from.obj([{ dirname: '/path/to/my/', path: '/path/to/my/file.js' }])
|
||||
.pipe(mkdirpStream.obj(function(obj, callback) {
|
||||
// callback can take 3 arguments (err, dirname, mode)
|
||||
callback(null, obj.dirname);
|
||||
}))
|
||||
.pipe(to.obj(function(obj) {
|
||||
// This will be called once the directory exists
|
||||
// obj === { dirname: '/path/to/my/', path: '/path/to/my/file.js' }
|
||||
}));
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `mkdirpStream(resolver)`
|
||||
|
||||
Takes a `resolver` function or string and returns a `through2` stream.
|
||||
|
||||
If the `resolver` is a function, it will be called once per chunk with the signature `(chunk, callback)`. The `callback(error, dirpath, mode)` must be called with the `dirpath` to be created as the 2nd parameter or an `error` as the 1st parameter; optionally with a `mode` as the 3rd parameter.
|
||||
|
||||
If the `resolver` is a string, it will be created/ensured for each chunk (e.g. if it were deleted between chunks, it would be recreated). When using a string, a custom `mode` can't be used.
|
||||
|
||||
### `mkdirpStream.obj(resolver)`
|
||||
|
||||
The same as the top-level API but for object streams. See the example to see the benefit of object streams with this module.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
Contains a custom implementation of `mkdirp` originally based on https://github.com/substack/node-mkdirp (Licensed MIT/X11 - Copyright 2010 James Halliday) with heavy modification to better support custom modes.
|
||||
|
||||
[downloads-image]: http://img.shields.io/npm/dm/fs-mkdirp-stream.svg
|
||||
[npm-url]: https://npmjs.com/package/fs-mkdirp-stream
|
||||
[npm-image]: http://img.shields.io/npm/v/fs-mkdirp-stream.svg
|
||||
|
||||
[travis-url]: https://travis-ci.org/gulpjs/fs-mkdirp-stream
|
||||
[travis-image]: http://img.shields.io/travis/gulpjs/fs-mkdirp-stream.svg?label=travis-ci
|
||||
|
||||
[appveyor-url]: https://ci.appveyor.com/project/gulpjs/fs-mkdirp-stream
|
||||
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/fs-mkdirp-stream.svg?label=appveyor
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/gulpjs/fs-mkdirp-stream
|
||||
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/fs-mkdirp-stream/master.svg
|
||||
|
||||
[gitter-url]: https://gitter.im/gulpjs/gulp
|
||||
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.png
|
50
node_modules/fs-mkdirp-stream/index.js
generated
vendored
Normal file
50
node_modules/fs-mkdirp-stream/index.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
var through = require('through2');
|
||||
|
||||
var mkdirp = require('./mkdirp');
|
||||
|
||||
function toFunction(dirpath) {
|
||||
function stringResolver(chunk, callback) {
|
||||
callback(null, dirpath);
|
||||
}
|
||||
|
||||
return stringResolver;
|
||||
}
|
||||
|
||||
function define(options) {
|
||||
|
||||
function mkdirpStream(resolver) {
|
||||
// Handle resolver that's just a dirpath
|
||||
if (typeof resolver === 'string') {
|
||||
resolver = toFunction(resolver);
|
||||
}
|
||||
|
||||
function makeFileDirs(chunk, enc, callback) {
|
||||
resolver(chunk, onDirpath);
|
||||
|
||||
function onDirpath(dirpathErr, dirpath, mode) {
|
||||
if (dirpathErr) {
|
||||
return callback(dirpathErr);
|
||||
}
|
||||
|
||||
mkdirp(dirpath, mode, onMkdirp);
|
||||
}
|
||||
|
||||
function onMkdirp(mkdirpErr) {
|
||||
if (mkdirpErr) {
|
||||
return callback(mkdirpErr);
|
||||
}
|
||||
|
||||
callback(null, chunk);
|
||||
}
|
||||
}
|
||||
|
||||
return through(options, makeFileDirs);
|
||||
}
|
||||
|
||||
return mkdirpStream;
|
||||
}
|
||||
|
||||
module.exports = define();
|
||||
module.exports.obj = define({ objectMode: true, highWaterMark: 16 });
|
71
node_modules/fs-mkdirp-stream/mkdirp.js
generated
vendored
Normal file
71
node_modules/fs-mkdirp-stream/mkdirp.js
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
|
||||
var fs = require('graceful-fs');
|
||||
|
||||
var MASK_MODE = parseInt('7777', 8);
|
||||
var DEFAULT_DIR_MODE = parseInt('0777', 8);
|
||||
|
||||
function mkdirp(dirpath, customMode, callback) {
|
||||
if (typeof customMode === 'function') {
|
||||
callback = customMode;
|
||||
customMode = undefined;
|
||||
}
|
||||
|
||||
var mode = customMode || (DEFAULT_DIR_MODE & ~process.umask());
|
||||
dirpath = path.resolve(dirpath);
|
||||
|
||||
fs.mkdir(dirpath, mode, onMkdir);
|
||||
|
||||
function onMkdir(mkdirErr) {
|
||||
if (!mkdirErr) {
|
||||
return fs.stat(dirpath, onStat);
|
||||
}
|
||||
|
||||
switch (mkdirErr.code) {
|
||||
case 'ENOENT': {
|
||||
return mkdirp(path.dirname(dirpath), onRecurse);
|
||||
}
|
||||
|
||||
case 'EEXIST': {
|
||||
return fs.stat(dirpath, onStat);
|
||||
}
|
||||
|
||||
default: {
|
||||
return callback(mkdirErr);
|
||||
}
|
||||
}
|
||||
|
||||
function onStat(statErr, stats) {
|
||||
if (statErr) {
|
||||
return callback(statErr);
|
||||
}
|
||||
|
||||
if (!stats.isDirectory()) {
|
||||
return callback(mkdirErr);
|
||||
}
|
||||
|
||||
// TODO: Is it proper to mask like this?
|
||||
if ((stats.mode & MASK_MODE) === mode) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
if (!customMode) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
fs.chmod(dirpath, mode, callback);
|
||||
}
|
||||
}
|
||||
|
||||
function onRecurse(recurseErr) {
|
||||
if (recurseErr) {
|
||||
return callback(recurseErr);
|
||||
}
|
||||
|
||||
mkdirp(dirpath, mode, callback);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = mkdirp;
|
52
node_modules/fs-mkdirp-stream/package.json
generated
vendored
Normal file
52
node_modules/fs-mkdirp-stream/package.json
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "fs-mkdirp-stream",
|
||||
"version": "1.0.0",
|
||||
"description": "Ensure directories exist before writing to them.",
|
||||
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)",
|
||||
"contributors": [
|
||||
"Blaine Bublitz <blaine.bublitz@gmail.com>"
|
||||
],
|
||||
"repository": "gulpjs/fs-mkdirp-stream",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"index.js",
|
||||
"mkdirp.js"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint index.js mkdirp.js test/ && jscs index.js mkdirp.js test/",
|
||||
"pretest": "npm run lint",
|
||||
"test": "mocha --async-only",
|
||||
"cover": "istanbul cover _mocha --report lcovonly",
|
||||
"coveralls": "npm run cover && istanbul-coveralls"
|
||||
},
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.1.11",
|
||||
"through2": "^2.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^1.10.3",
|
||||
"eslint-config-gulp": "^2.0.0",
|
||||
"expect": "^1.20.2",
|
||||
"istanbul": "^0.4.3",
|
||||
"istanbul-coveralls": "^1.0.3",
|
||||
"jscs": "^2.4.0",
|
||||
"jscs-preset-gulp": "^1.0.0",
|
||||
"mississippi": "^1.3.0",
|
||||
"mocha": "^3.2.0",
|
||||
"rimraf": "^2.6.1"
|
||||
},
|
||||
"keywords": [
|
||||
"fs",
|
||||
"mkdirp",
|
||||
"stream",
|
||||
"mkdir",
|
||||
"directory",
|
||||
"directories",
|
||||
"ensure"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user