to-single-quotes

Convert matching double-quotes to single-quotes: I "love" unicorns => I 'love' unicorns

to-single-quotes

Convert matching double-quotes to single-quotes: I "love" unicorns => I 'love' unicorns

$ npm install --save to-single-quotes
var toSingleQuotes = require('to-single-quotes');
 
toSingleQuotes('I love "unicorns" \'and\' "ponies"');
//=> I love 'unicorns' 'and' 'ponies' 
$ npm install --global to-single-quotes
$ to-single-quotes --help
 
  Usage
    $ to-single-quotes <string>
    $ echo <string> | to-single-quotes
 
  Example
    $ to-single-quotes 'I love "unicorns"'
    I love 'unicorns'

See to-double-quotes for the inverse.

MIT © Sindre Sorhus