1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-03 04:10:04 +02:00

add some packages

This commit is contained in:
s2
2018-05-05 13:54:07 +02:00
parent 48c1138518
commit ff6e20677d
3738 changed files with 215920 additions and 0 deletions

4
node_modules/v8flags/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,4 @@
*.yml
LICENSE
README.md
test.js

22
node_modules/v8flags/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
Copyright (c) 2014 Tyler Kellen
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.

49
node_modules/v8flags/README.md generated vendored Normal file
View File

@@ -0,0 +1,49 @@
# v8flags [![Build Status](https://secure.travis-ci.org/js-cli/js-v8flags.png)](http://travis-ci.org/js-cli/js-v8flags) [![Build status](https://ci.appveyor.com/api/projects/status/9psgmwayx9kpol1a?svg=true)](https://ci.appveyor.com/project/js-cli/js-v8flags)
> Get available v8 flags.
[![NPM](https://nodei.co/npm/v8flags.png)](https://nodei.co/npm/v8flags/)
## Example
```js
const v8flags = require('v8flags');
v8flags(function (err, results) {
console.log(results); // [ '--use_strict',
// '--es5_readonly',
// '--es52_globals',
// '--harmony_typeof',
// '--harmony_scoping',
// '--harmony_modules',
// '--harmony_proxies',
// '--harmony_collections',
// '--harmony',
// ...
});
```
## Release History
* 2017-04-18 - v2.1.0 - hash username to support invalid path characters
* 2017-03-31 - v2.0.12 - don't pollute global namespace
* 2015-12-07 - v2.0.11 - cache to temp directory if home is present but unwritable
* 2015-07-28 - v2.0.10 - don't throw for electron runtime, just call back with empty array
* 2015-06-25 - v2.0.9 - call back with flags even if cache file can't be written
* 2015-06-15 - v2.0.7 - revert to 2.0.5 behavior.
* 2015-06-15 - v2.0.6 - store cache file in ~/.cache or ~/AppData/Local depending on platform
* 2015-04-18 - v2.0.5 - attempt to require config file, if this throws for any reason, fopen w+ and re-create
* 2015-04-16 - v2.0.4 - when concurrent processes are run and no config exists, don't append to the cached config.
* 2015-03-31 - v2.0.3 - prefer to store config files in user home over tmp
* 2015-01-18 - v2.0.2 - keep his dark tentacles contained
* 2015-01-15 - v2.0.1 - store temp file in `os.tmpdir()`, drop support for node 0.8
* 2015-01-15 - v2.0.0 - make the stupid thing async
* 2014-12-22 - v1.0.8 - exclude `--help` flag
* 2014-12-20 - v1.0.7 - pre-cache flags for every version of node from 0.8 to 0.11
* 2014-12-09 - v1.0.6 - revert to 1.0.0 behavior
* 2014-11-26 - v1.0.5 - get node executable from `process.execPath`
* 2014-11-18 - v1.0.4 - wrap node executable path in quotes
* 2014-11-17 - v1.0.3 - get node executable during npm install via `process.env.NODE`
* 2014-11-17 - v1.0.2 - get node executable from `process.env._`
* 2014-09-03 - v1.0.0 - first major version release
* 2014-09-02 - v0.3.0 - keep -- in flag names
* 2014-09-02 - v0.2.0 - cache flags
* 2014-05-09 - v0.1.0 - initial release

133
node_modules/v8flags/index.js generated vendored Normal file
View File

@@ -0,0 +1,133 @@
// this entire module is depressing. i should have spent my time learning
// how to patch v8 so that these options would just be available on the
// process object.
const os = require('os');
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const execFile = require('child_process').execFile;
const env = process.env;
const user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME || '';
const exclusions = ['--help'];
const configfile = '.v8flags.'+process.versions.v8+'.'+crypto.createHash('md5').update(user).digest('hex')+'.json';
const failureMessage = [
'Unable to cache a config file for v8flags to a your home directory',
'or a temporary folder. To fix this problem, please correct your',
'environment by setting HOME=/path/to/home or TEMP=/path/to/temp.',
'NOTE: the user running this must be able to access provided path.',
'If all else fails, please open an issue here:',
'http://github.com/tkellen/js-v8flags'
].join('\n');
function fail (err) {
err.message += '\n\n' + failureMessage;
return err;
}
function openConfig (cb) {
var userHome = require('user-home');
if (!userHome) {
return tryOpenConfig(path.join(os.tmpdir(), configfile), cb);
}
tryOpenConfig(path.join(userHome, configfile), function (err, fd) {
if (err) return tryOpenConfig(path.join(os.tmpdir(), configfile), cb);
return cb(null, fd);
});
}
function tryOpenConfig (configpath, cb) {
try {
// if the config file is valid, it should be json and therefore
// node should be able to require it directly. if this doesn't
// throw, we're done!
var content = require(configpath);
process.nextTick(function () {
cb(null, content);
});
} catch (e) {
// if requiring the config file failed, maybe it doesn't exist, or
// perhaps it has become corrupted. instead of calling back with the
// content of the file, call back with a file descriptor that we can
// write the cached data to
fs.open(configpath, 'w+', function (err, fd) {
if (err) {
return cb(err);
}
return cb(null, fd);
});
}
}
// i can't wait for the day this whole module is obsolete because these
// options are available on the process object. this executes node with
// `--v8-options` and parses the result, returning an array of command
// line flags.
function getFlags (cb) {
execFile(process.execPath, ['--v8-options'], function (execErr, result) {
if (execErr) {
return cb(execErr);
}
var flags = result.match(/\s\s--(\w+)/gm).map(function (match) {
return match.substring(2);
}).filter(function (name) {
return exclusions.indexOf(name) === -1;
});
return cb(null, flags);
});
}
// write some json to a file descriptor. if this fails, call back
// with both the error and the data that was meant to be written.
function writeConfig (fd, flags, cb) {
var buf = new Buffer(JSON.stringify(flags));
return fs.write(fd, buf, 0, buf.length, 0 , function (writeErr) {
fs.close(fd, function (closeErr) {
var err = writeErr || closeErr;
if (err) {
return cb(fail(err), flags);
}
return cb(null, flags);
});
});
}
module.exports = function (cb) {
// bail early if this is not node
var isElectron = process.versions && process.versions.electron;
if (isElectron) {
return process.nextTick(function () {
cb(null, []);
});
}
// attempt to open/read cache file
openConfig(function (openErr, result) {
if (!openErr && typeof result !== 'number') {
return cb(null, result);
}
// if the result is not an array, we need to go fetch
// the flags by invoking node with `--v8-options`
getFlags(function (flagsErr, flags) {
// if there was an error fetching the flags, bail immediately
if (flagsErr) {
return cb(flagsErr);
}
// if there was a problem opening the config file for writing
// throw an error but include the flags anyway so that users
// can continue to execute (at the expense of having to fetch
// flags on every run until they fix the underyling problem).
if (openErr) {
return cb(fail(openErr), flags);
}
// write the config file to disk so subsequent runs can read
// flags out of a cache file.
return writeConfig(result, flags, cb);
});
});
};
module.exports.configfile = configfile;

67
node_modules/v8flags/package.json generated vendored Normal file
View File

@@ -0,0 +1,67 @@
{
"_from": "v8flags@^2.1.1",
"_id": "v8flags@2.1.1",
"_inBundle": false,
"_integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=",
"_location": "/v8flags",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "v8flags@^2.1.1",
"name": "v8flags",
"escapedName": "v8flags",
"rawSpec": "^2.1.1",
"saveSpec": null,
"fetchSpec": "^2.1.1"
},
"_requiredBy": [
"/babel-cli"
],
"_resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz",
"_shasum": "aab1a1fa30d45f88dd321148875ac02c0b55e5b4",
"_spec": "v8flags@^2.1.1",
"_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/babel-cli",
"author": {
"name": "Tyler Kellen",
"url": "http://goingslowly.com/"
},
"bugs": {
"url": "https://github.com/tkellen/node-v8flags/issues"
},
"bundleDependencies": false,
"dependencies": {
"user-home": "^1.1.1"
},
"deprecated": false,
"description": "Get available v8 flags.",
"devDependencies": {
"async": "^0.9.0",
"chai": "~1.9.1",
"mocha": "~1.21.4"
},
"engines": {
"node": ">= 0.10.0"
},
"homepage": "https://github.com/tkellen/node-v8flags",
"keywords": [
"v8 flags",
"harmony flags"
],
"licenses": [
{
"type": "MIT",
"url": "https://github.com/tkellen/node-v8flags/blob/master/LICENSE"
}
],
"main": "index.js",
"name": "v8flags",
"repository": {
"type": "git",
"url": "git://github.com/tkellen/node-v8flags.git"
},
"scripts": {
"test": "_mocha -R spec test.js"
},
"version": "2.1.1"
}