detect-indent
Advanced tools
Comparing version 0.1.4 to 0.2.0
{ | ||
"name": "detect-indent", | ||
"version": "0.1.4", | ||
"version": "0.2.0", | ||
"description": "Detect the indentation of code", | ||
"license": "MIT", | ||
"repository": "sindresorhus/detect-indent", | ||
"bin": { | ||
"detect-indent": "cli.js" | ||
}, | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"cli.js" | ||
], | ||
"keywords": [ | ||
"cli", | ||
"bin", | ||
"indent", | ||
@@ -18,28 +40,9 @@ "indentation", | ||
], | ||
"license": "MIT", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
"dependencies": { | ||
"get-stdin": "^0.1.0", | ||
"minimist": "^0.1.0" | ||
}, | ||
"files": [ | ||
"detect-indent.js" | ||
], | ||
"main": "detect-indent", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/sindresorhus/detect-indent.git" | ||
}, | ||
"scripts": { | ||
"test": "mocha && phantomjs node_modules/mocha-phantomjs/lib/mocha-phantomjs.coffee test/test.html" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.12.0", | ||
"chai": "~1.7.2", | ||
"phantomjs": "~1.9.1", | ||
"mocha-phantomjs": "~3.1.0" | ||
}, | ||
"engines": { | ||
"node": ">=0.8.0" | ||
"mocha": "*" | ||
} | ||
} |
@@ -17,27 +17,15 @@ # detect-indent [![Build Status](https://travis-ci.org/sindresorhus/detect-indent.svg?branch=master)](https://travis-ci.org/sindresorhus/detect-indent) | ||
Download [manually](https://github.com/sindresorhus/detect-indent/releases) or with a package-manager. | ||
```bash | ||
```sh | ||
$ npm install --save detect-indent | ||
``` | ||
```bash | ||
$ bower install --save detect-indent | ||
``` | ||
```bash | ||
$ component install sindresorhus/detect-indent | ||
``` | ||
## Usage | ||
## API | ||
Accepts a string and returns the indentation or `null` if it can't be detected. | ||
## Usage | ||
Modify a JSON file while persisting the indentation in Node.js. | ||
```js | ||
// modify a JSON file while persisting the indentation in Node | ||
var fs = require('fs'); | ||
@@ -66,4 +54,23 @@ var detectIndent = require('detect-indent'); | ||
## CLI | ||
```sh | ||
$ npm install --global detect-indent | ||
``` | ||
```sh | ||
$ detect-indent --help | ||
Usage | ||
$ detect-indent <file> | ||
$ echo <string> | detect-indent | ||
Example | ||
$ echo ' foo\n bar' | detect-indent | wc --chars | ||
2 | ||
``` | ||
## License | ||
[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com) | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4209
1
4
95
75
2
2
1
+ Addedget-stdin@^0.1.0
+ Addedminimist@^0.1.0
+ Addedget-stdin@0.1.0(transitive)
+ Addedminimist@0.1.0(transitive)