to-single-quotes
Advanced tools
Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "to-single-quotes", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Convert matching double-quotes to single-quotes: I \"love\" unicorns => I 'love' unicorns", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -12,43 +12,17 @@ # to-single-quotes [![Build Status](https://travis-ci.org/sindresorhus/to-single-quotes.svg?branch=master)](https://travis-ci.org/sindresorhus/to-single-quotes) | ||
#### [npm](https://npmjs.org/package/to-single-quotes) | ||
```bash | ||
$ npm install --save to-single-quotes | ||
``` | ||
npm install --save to-single-quotes | ||
``` | ||
Or globally if you want to use it as a CLI app: | ||
```bash | ||
$ bower install --save to-single-quotes | ||
``` | ||
npm install --global to-single-quotes | ||
``` | ||
You can then use it in your terminal like: | ||
```bash | ||
$ component install sindresorhus/to-single-quotes | ||
``` | ||
to-single-quotes src/*.txt | ||
``` | ||
*(make sure to have a backup before running this!)* | ||
Or pipe something to it: | ||
## Usage | ||
``` | ||
cat input.txt | to-single-quotes > output.txt | ||
``` | ||
#### [Bower](http://bower.io) | ||
``` | ||
bower install --save to-single-quotes | ||
``` | ||
#### [Component](https://github.com/component/component) | ||
``` | ||
component install sindresorhus/to-single-quotes | ||
``` | ||
## Example | ||
##### Node.js | ||
@@ -74,4 +48,26 @@ | ||
## CLI | ||
You can also use it as a CLI app by installing it globally: | ||
```bash | ||
$ npm install --global to-single-quotes | ||
``` | ||
### Usage | ||
```bash | ||
$ to-single-quotes --help | ||
Usage | ||
to-single-quotes <path|glob> | ||
cat input.txt | to-single-quotes > output.txt | ||
Example | ||
to-single-quotes src/*.txt | ||
``` | ||
## License | ||
[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com) |
@@ -11,3 +11,3 @@ /*! | ||
var toSingleQuotes = function (str) { | ||
return str.replace(/(?:\\*)?"([^"\\]*\\")*[^"]*"/g, function (match) { | ||
return str.replace(/(?:\\*)?"([^"\\]*\\.)*[^"]*"/g, function (match) { | ||
return match | ||
@@ -14,0 +14,0 @@ .replace(/\\"/g, '"') // unescape double-quotes |
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
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
3879
72