Socket
Socket
Sign inDemoInstall

quote

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    quote

Add quotes to given string unless it already has them


Version published
Maintainers
1
Install size
8.47 kB
Created

Readme

Source

quote

Safe quoting a given string without adding duplicate quotes

NPM info

Build status dependencies devdependencies

Install using node or bower

npm install quote --save
bower install quote --save

Use

// node
var quote = require('quote');
quote('foo'); // "foo"
quote('"foo"'); // "foo"
quote(quote('foo')); // "foo"

In the browser just use global function quote

Changing quote character

Only single quote character is supported, default is double quotes ". To change:

var quote = require('quote')({ quotes: '*' });
quote('foo'); // *foo*
quote('bar'); // *bar*

To build and test

Because this is both Node and browser package, you need to build it using universal module definition CLI tool.

npm run build
npm test

Small print

Author: Gleb Bahmutov © 2014 @bahmutov glebbahmutov.com

License: MIT - do anything with the code, but don't blame me if it does not work.

Spread the word: tweet, star on github, etc.

Support: if you find any problems with this module, email / tweet / open issue on Github

Keywords

FAQs

Last updated on 09 Feb 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc