Remove modules from source

This commit is contained in:
Federico Grandi
2019-12-14 21:58:11 +01:00
parent f118062594
commit e5272e4c09
4269 changed files with 0 additions and 1074858 deletions

View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2019 Rodolphe Stoclin
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.

View File

@@ -1,21 +0,0 @@
<p align="center"><img src="/static/node-minify.png" width="348" alt="node-minify"></p>
<p align="center">A very light minifier Node.js module.</p>
<p align="center">
<br>
<a href="https://npmjs.org/package/@node-minify/utils"><img src="https://img.shields.io/npm/v/@node-minify/utils.svg"></a>
<a href="https://npmjs.org/package/@node-minify/utils"><img src="https://img.shields.io/npm/dm/@node-minify/utils.svg"></a>
<a href="https://codecov.io/gh/srod/node-minify"><img src="https://codecov.io/gh/srod/node-minify/branch/develop/graph/badge.svg"></a><br>
<a href="https://travis-ci.org/srod/node-minify"><img src="https://img.shields.io/travis/srod/node-minify/master.svg?label=linux"></a>
<a href="https://dev.azure.com/srodolphe/srodolphe/_build/latest?definitionId=1"><img src="https://dev.azure.com/srodolphe/srodolphe/_apis/build/status/srod.node-minify?branchName=master"></a>
<a href="https://circleci.com/gh/srod/node-minify/tree/master"><img src="https://circleci.com/gh/srod/node-minify/tree/master.svg?style=shield"></a>
</p>
# utils
`utils` is parts of [`node-minify`](https://github.com/srod/node-minify).
## License
[MIT](https://github.com/srod/node-minify/blob/develop/LICENSE)

View File

@@ -1,159 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.utils = void 0;
var _fs = _interopRequireDefault(require("fs"));
var _gzipSize = _interopRequireDefault(require("gzip-size"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*!
* node-minify
* Copyright(c) 2011-2019 Rodolphe Stoclin
* MIT Licensed
*/
/**
* Module dependencies.
*/
const utils = {};
/**
* Read content from file.
*
* @param {String} file
* @returns {String}
*/
exports.utils = utils;
utils.readFile = file => _fs.default.readFileSync(file, 'utf8');
/**
* Write content into file.
*
* @param {String} file
* @param {String} content
* @param {Number} index - index of the file being processed
* @returns {String}
*/
utils.writeFile = ({
file,
content,
index
}) => {
_fs.default.writeFileSync(index !== undefined ? file[index] : file, content, 'utf8');
return content;
};
/**
* Builds arguments array based on an object.
*
* @param {Object} options
* @returns {Array}
*/
utils.buildArgs = options => {
const args = [];
Object.keys(options).forEach(key => {
if (options[key] && options[key] !== false) {
args.push('--' + key);
}
if (options[key] && options[key] !== true) {
args.push(options[key]);
}
});
return args;
};
/**
* Clone an object.
*
* @param {Object} obj
* @returns {Object}
*/
utils.clone = obj => JSON.parse(JSON.stringify(obj));
/**
* Get the file size in bytes.
*
* @returns {String}
*/
utils.getFilesizeInBytes = file => {
const stats = _fs.default.statSync(file);
const fileSizeInBytes = stats.size;
return utils.prettyBytes(fileSizeInBytes);
};
/**
* Get the gzipped file size in bytes.
*
* @returns {Promise.<String>}
*/
utils.getFilesizeGzippedInBytes = file => {
return new Promise(resolve => {
const source = _fs.default.createReadStream(file);
source.pipe(_gzipSize.default.stream()).on('gzip-size', size => {
resolve(utils.prettyBytes(size));
});
});
};
/**
* Get the size in human readable.
* From https://github.com/sindresorhus/pretty-bytes
*
* @returns {String}
*/
utils.prettyBytes = num => {
const UNITS = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
if (!Number.isFinite(num)) {
throw new TypeError(`Expected a finite number, got ${typeof num}: ${num}`);
}
const neg = num < 0;
if (neg) {
num = -num;
}
if (num < 1) {
return (neg ? '-' : '') + num + ' B';
}
const exponent = Math.min(Math.floor(Math.log(num) / Math.log(1000)), UNITS.length - 1);
const numStr = Number((num / Math.pow(1000, exponent)).toPrecision(3));
const unit = UNITS[exponent];
return (neg ? '-' : '') + numStr + ' ' + unit;
};
/**
* Set the file name as minified.
* eg. file.js returns file.min.js
*
* @param {String} file
* @param {String} output
* @returns {String}
*/
utils.setFileNameMin = function (file, output) {
const fileWithoutPath = file.substr(file.lastIndexOf('/') + 1);
const fileWithoutExtension = fileWithoutPath.substr(0, fileWithoutPath.lastIndexOf('.js'));
return output.replace('$1', fileWithoutExtension);
};
/**
* Expose `utils`.
*/

View File

@@ -1,73 +0,0 @@
{
"_args": [
[
"@node-minify/utils@4.1.2",
"/home/runner/work/add-and-commit/add-and-commit"
]
],
"_development": true,
"_from": "@node-minify/utils@4.1.2",
"_id": "@node-minify/utils@4.1.2",
"_inBundle": false,
"_integrity": "sha512-ary5uJEZOt35lhjg+64rFc5uy1CSiQyosUzPpHtchpOqGVYO0Yj2AMvEIgGGK1nDuHq7j6sfzrZBAOFXmIh2oQ==",
"_location": "/@node-minify/utils",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@node-minify/utils@4.1.2",
"name": "@node-minify/utils",
"escapedName": "@node-minify%2futils",
"scope": "@node-minify",
"rawSpec": "4.1.2",
"saveSpec": null,
"fetchSpec": "4.1.2"
},
"_requiredBy": [
"/@node-minify/babel-minify",
"/@node-minify/cli",
"/@node-minify/core"
],
"_resolved": "https://registry.npmjs.org/@node-minify/utils/-/utils-4.1.2.tgz",
"_spec": "4.1.2",
"_where": "/home/runner/work/add-and-commit/add-and-commit",
"author": {
"name": "Rodolphe Stoclin",
"email": "srodolphe@gmail.com"
},
"bugs": {
"url": "https://github.com/srod/node-minify/issues"
},
"dependencies": {
"gzip-size": "5.1.1"
},
"description": "utils for @node-minify",
"directories": {
"lib": "lib",
"test": "__tests__"
},
"engines": {
"node": ">=6.0.0"
},
"files": [
"lib"
],
"gitHead": "b13f16dfcac6f151c371414cf3a8a2969ff08783",
"homepage": "https://github.com/srod/node-minify/tree/master/packages/utils#readme",
"keywords": [
"compressor",
"minify",
"minifier"
],
"license": "MIT",
"main": "lib/utils.js",
"name": "@node-minify/utils",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/srod/node-minify.git"
},
"version": "4.1.2"
}