A new start

This commit is contained in:
2018-11-24 14:43:59 +01:00
commit 3c32c8a37a
24054 changed files with 1376258 additions and 0 deletions

42
node_modules/strip-bom/cli.js generated vendored Executable file
View File

@@ -0,0 +1,42 @@
#!/usr/bin/env node
'use strict';
var fs = require('fs');
var pkg = require('./package.json');
var stripBom = require('./');
var argv = process.argv.slice(2);
var input = argv[0];
function help() {
console.log([
'',
' ' + pkg.description,
'',
' Usage',
' strip-bom <file> > <new-file>',
' cat <file> | strip-bom > <new-file>',
'',
' Example',
' strip-bom unicorn.txt > unicorn-without-bom.txt'
].join('\n'));
}
if (argv.indexOf('--help') !== -1) {
help();
return;
}
if (argv.indexOf('--version') !== -1) {
console.log(pkg.version);
return;
}
if (process.stdin.isTTY) {
if (!input) {
help();
return;
}
fs.createReadStream(input).pipe(stripBom.stream()).pipe(process.stdout);
} else {
process.stdin.pipe(stripBom.stream()).pipe(process.stdout);
}

24
node_modules/strip-bom/index.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
'use strict';
var isUtf8 = require('is-utf8');
var stripBom = module.exports = function (arg) {
if (typeof arg === 'string') {
return arg.replace(/^\ufeff/g, '');
}
if (Buffer.isBuffer(arg) && isUtf8(arg) &&
arg[0] === 0xef && arg[1] === 0xbb && arg[2] === 0xbf) {
return arg.slice(3);
}
return arg;
};
stripBom.stream = function () {
var firstChunk = require('first-chunk-stream');
return firstChunk({minSize: 3}, function (chunk, enc, cb) {
this.push(stripBom(chunk));
cb();
});
};

84
node_modules/strip-bom/package.json generated vendored Normal file
View File

@@ -0,0 +1,84 @@
{
"_from": "strip-bom@^1.0.0",
"_id": "strip-bom@1.0.0",
"_inBundle": false,
"_integrity": "sha1-hbiGLzhEtabV7IRnqTWYFzo295Q=",
"_location": "/strip-bom",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "strip-bom@^1.0.0",
"name": "strip-bom",
"escapedName": "strip-bom",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/vinyl-fs"
],
"_resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz",
"_shasum": "85b8862f3844b5a6d5ec8467a93598173a36f794",
"_spec": "strip-bom@^1.0.0",
"_where": "/var/www/html/autocompletion/node_modules/vinyl-fs",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
},
"bin": {
"strip-bom": "cli.js"
},
"bugs": {
"url": "https://github.com/sindresorhus/strip-bom/issues"
},
"bundleDependencies": false,
"dependencies": {
"first-chunk-stream": "^1.0.0",
"is-utf8": "^0.2.0"
},
"deprecated": false,
"description": "Strip UTF-8 byte order mark (BOM) from a string/buffer/stream",
"devDependencies": {
"concat-stream": "^1.4.5",
"mocha": "*"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"cli.js",
"index.js"
],
"homepage": "https://github.com/sindresorhus/strip-bom#readme",
"keywords": [
"cli",
"bin",
"app",
"bom",
"strip",
"byte",
"mark",
"unicode",
"utf8",
"utf-8",
"remove",
"trim",
"text",
"buffer",
"string",
"stream",
"streams"
],
"license": "MIT",
"name": "strip-bom",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/strip-bom.git"
},
"scripts": {
"test": "mocha"
},
"version": "1.0.0"
}

59
node_modules/strip-bom/readme.md generated vendored Normal file
View File

@@ -0,0 +1,59 @@
# strip-bom [![Build Status](https://travis-ci.org/sindresorhus/strip-bom.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-bom)
> Strip UTF-8 [byte order mark](http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string/buffer/stream
From Wikipedia:
> The Unicode Standard permits the BOM in UTF-8, but does not require nor recommend its use. Byte order has no meaning in UTF-8.
## Usage
```sh
$ npm install --save strip-bom
```
```js
var fs = require('fs');
var stripBom = require('strip-bom');
stripBom('\ufeffUnicorn');
//=> Unicorn
stripBom(fs.readFileSync('unicorn.txt'));
//=> Unicorn
```
Or as a [Transform stream](http://nodejs.org/api/stream.html#stream_class_stream_transform):
```js
var fs = require('fs');
var stripBom = require('strip-bom');
fs.createReadStream('unicorn.txt')
.pipe(stripBom.stream())
.pipe(fs.createWriteStream('unicorn.txt'));
```
## CLI
```sh
$ npm install --global strip-bom
```
```
$ strip-bom --help
Usage
strip-bom <file> > <new-file>
cat <file> | strip-bom > <new-file>
Example
strip-bom unicorn.txt > unicorn-without-bom.txt
```
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)