mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 05:13:33 -06:00
Initial commit
This commit is contained in:
49
node_modules/strip-indent/cli.js
generated
vendored
Executable file
49
node_modules/strip-indent/cli.js
generated
vendored
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
var fs = require('fs');
|
||||
var stdin = require('get-stdin');
|
||||
var pkg = require('./package.json');
|
||||
var stripIndent = require('./');
|
||||
var argv = process.argv.slice(2);
|
||||
var input = argv[0];
|
||||
|
||||
function help() {
|
||||
console.log([
|
||||
'',
|
||||
' ' + pkg.description,
|
||||
'',
|
||||
' Usage',
|
||||
' strip-indent <file>',
|
||||
' echo <string> | strip-indent',
|
||||
'',
|
||||
' Example',
|
||||
' echo \'\\tunicorn\\n\\t\\tcake\' | strip-indent',
|
||||
' unicorn',
|
||||
' \tcake'
|
||||
].join('\n'));
|
||||
}
|
||||
|
||||
function init(data) {
|
||||
console.log(stripIndent(data));
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
init(fs.readFileSync(input, 'utf8'));
|
||||
} else {
|
||||
stdin(init);
|
||||
}
|
16
node_modules/strip-indent/index.js
generated
vendored
Normal file
16
node_modules/strip-indent/index.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
module.exports = function (str) {
|
||||
var match = str.match(/^[ \t]*(?=\S)/gm);
|
||||
|
||||
if (!match) {
|
||||
return str;
|
||||
}
|
||||
|
||||
var indent = Math.min.apply(Math, match.map(function (el) {
|
||||
return el.length;
|
||||
}));
|
||||
|
||||
var re = new RegExp('^[ \\t]{' + indent + '}', 'gm');
|
||||
|
||||
return indent > 0 ? str.replace(re, '') : str;
|
||||
};
|
21
node_modules/strip-indent/license
generated
vendored
Normal file
21
node_modules/strip-indent/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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/strip-indent/node_modules/get-stdin/index.js
generated
vendored
Normal file
49
node_modules/strip-indent/node_modules/get-stdin/index.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (cb) {
|
||||
var stdin = process.stdin;
|
||||
var ret = '';
|
||||
|
||||
if (stdin.isTTY) {
|
||||
setImmediate(cb, '');
|
||||
return;
|
||||
}
|
||||
|
||||
stdin.setEncoding('utf8');
|
||||
|
||||
stdin.on('readable', function () {
|
||||
var chunk;
|
||||
|
||||
while (chunk = stdin.read()) {
|
||||
ret += chunk;
|
||||
}
|
||||
});
|
||||
|
||||
stdin.on('end', function () {
|
||||
cb(ret);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.buffer = function (cb) {
|
||||
var stdin = process.stdin;
|
||||
var ret = [];
|
||||
var len = 0;
|
||||
|
||||
if (stdin.isTTY) {
|
||||
setImmediate(cb, new Buffer(''));
|
||||
return;
|
||||
}
|
||||
|
||||
stdin.on('readable', function () {
|
||||
var chunk;
|
||||
|
||||
while (chunk = stdin.read()) {
|
||||
ret.push(chunk);
|
||||
len += chunk.length;
|
||||
}
|
||||
});
|
||||
|
||||
stdin.on('end', function () {
|
||||
cb(Buffer.concat(ret, len));
|
||||
});
|
||||
};
|
90
node_modules/strip-indent/node_modules/get-stdin/package.json
generated
vendored
Normal file
90
node_modules/strip-indent/node_modules/get-stdin/package.json
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"get-stdin@^4.0.1",
|
||||
"/Users/pmarsceill/_projects/just-the-docs/node_modules/strip-indent"
|
||||
]
|
||||
],
|
||||
"_from": "get-stdin@>=4.0.1 <5.0.0",
|
||||
"_id": "get-stdin@4.0.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/strip-indent/get-stdin",
|
||||
"_npmUser": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "sindresorhus"
|
||||
},
|
||||
"_npmVersion": "1.4.28",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "get-stdin",
|
||||
"raw": "get-stdin@^4.0.1",
|
||||
"rawSpec": "^4.0.1",
|
||||
"scope": null,
|
||||
"spec": ">=4.0.1 <5.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/strip-indent"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
|
||||
"_shasum": "b968c6b0a04384324902e8bf1a5df32579a450fe",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "get-stdin@^4.0.1",
|
||||
"_where": "/Users/pmarsceill/_projects/just-the-docs/node_modules/strip-indent",
|
||||
"author": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "Sindre Sorhus",
|
||||
"url": "http://sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/get-stdin/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Easier stdin",
|
||||
"devDependencies": {
|
||||
"ava": "0.0.4",
|
||||
"buffer-equal": "0.0.1"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "b968c6b0a04384324902e8bf1a5df32579a450fe",
|
||||
"tarball": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "65c744975229b25d6cc5c7546f49b6ad9099553f",
|
||||
"homepage": "https://github.com/sindresorhus/get-stdin",
|
||||
"keywords": [
|
||||
"buffer",
|
||||
"concat",
|
||||
"process",
|
||||
"std",
|
||||
"stdin",
|
||||
"stdio",
|
||||
"stream",
|
||||
"stream"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "sindresorhus",
|
||||
"email": "sindresorhus@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "get-stdin",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/get-stdin.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js && node test-buffer.js && echo unicorns | node test-real.js"
|
||||
},
|
||||
"version": "4.0.1"
|
||||
}
|
44
node_modules/strip-indent/node_modules/get-stdin/readme.md
generated
vendored
Normal file
44
node_modules/strip-indent/node_modules/get-stdin/readme.md
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
# get-stdin [](https://travis-ci.org/sindresorhus/get-stdin)
|
||||
|
||||
> Easier stdin
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save get-stdin
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// example.js
|
||||
var stdin = require('get-stdin');
|
||||
|
||||
stdin(function (data) {
|
||||
console.log(data);
|
||||
//=> unicorns
|
||||
});
|
||||
```
|
||||
|
||||
```sh
|
||||
$ echo unicorns | node example.js
|
||||
unicorns
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### stdin(callback)
|
||||
|
||||
Get `stdin` as a string.
|
||||
|
||||
### stdin.buffer(callback)
|
||||
|
||||
Get `stdin` as a buffer.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
101
node_modules/strip-indent/package.json
generated
vendored
Normal file
101
node_modules/strip-indent/package.json
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"strip-indent@^1.0.1",
|
||||
"/Users/pmarsceill/_projects/just-the-docs/node_modules/redent"
|
||||
]
|
||||
],
|
||||
"_from": "strip-indent@>=1.0.1 <2.0.0",
|
||||
"_id": "strip-indent@1.0.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/strip-indent",
|
||||
"_nodeVersion": "0.12.0",
|
||||
"_npmUser": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "sindresorhus"
|
||||
},
|
||||
"_npmVersion": "2.5.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "strip-indent",
|
||||
"raw": "strip-indent@^1.0.1",
|
||||
"rawSpec": "^1.0.1",
|
||||
"scope": null,
|
||||
"spec": ">=1.0.1 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/redent"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz",
|
||||
"_shasum": "0c7962a6adefa7bbd4ac366460a638552ae1a0a2",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "strip-indent@^1.0.1",
|
||||
"_where": "/Users/pmarsceill/_projects/just-the-docs/node_modules/redent",
|
||||
"author": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "Sindre Sorhus",
|
||||
"url": "http://sindresorhus.com"
|
||||
},
|
||||
"bin": {
|
||||
"strip-indent": "cli.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/strip-indent/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"get-stdin": "^4.0.1"
|
||||
},
|
||||
"description": "Strip leading whitespace from every line in a string",
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "0c7962a6adefa7bbd4ac366460a638552ae1a0a2",
|
||||
"tarball": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"cli.js",
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "addcf90a56001ea122e9f1254987016bc87e5b5f",
|
||||
"homepage": "https://github.com/sindresorhus/strip-indent",
|
||||
"keywords": [
|
||||
"bin",
|
||||
"browser",
|
||||
"cli",
|
||||
"indent",
|
||||
"indentation",
|
||||
"normalize",
|
||||
"remove",
|
||||
"space",
|
||||
"str",
|
||||
"string",
|
||||
"strip",
|
||||
"tab",
|
||||
"whitespace"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "sindresorhus",
|
||||
"email": "sindresorhus@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "strip-indent",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/strip-indent.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"version": "1.0.1"
|
||||
}
|
61
node_modules/strip-indent/readme.md
generated
vendored
Normal file
61
node_modules/strip-indent/readme.md
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
# strip-indent [](https://travis-ci.org/sindresorhus/strip-indent)
|
||||
|
||||
> Strip leading whitespace from every line in a string
|
||||
|
||||
The line with the least number of leading whitespace, ignoring empty lines, determines the number to remove.
|
||||
|
||||
Useful for removing redundant indentation.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save strip-indent
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var str = '\tunicorn\n\t\tcake';
|
||||
/*
|
||||
unicorn
|
||||
cake
|
||||
*/
|
||||
|
||||
stripIndent('\tunicorn\n\t\tcake');
|
||||
/*
|
||||
unicorn
|
||||
cake
|
||||
*/
|
||||
```
|
||||
|
||||
|
||||
## CLI
|
||||
|
||||
```sh
|
||||
$ npm install --global strip-indent
|
||||
```
|
||||
|
||||
```sh
|
||||
$ strip-indent --help
|
||||
|
||||
Usage
|
||||
strip-indent <file>
|
||||
echo <string> | strip-indent
|
||||
|
||||
Example
|
||||
echo '\tunicorn\n\t\tcake' | strip-indent
|
||||
unicorn
|
||||
cake
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [indent-string](https://github.com/sindresorhus/indent-string) - Indent each line in a string
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
Reference in New Issue
Block a user