Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

detect-indent

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-indent - npm Package Compare versions

Comparing version 0.1.4 to 0.2.0

cli.js

51

package.json
{
"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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc