string-quote-x
v3.1.2
Published
Wrap a string in double quotes.
Downloads
8
Maintainers
Readme
string-quote-x
Wrap a string in double quotes.
module.exports(string)
⇒ string ⏏
This method wraps a string in double quotes and replaces control characters with safe escape sequences.
Kind: Exported function
Returns: string - The wrapped string.
| Param | Type | Description | | ------ | ------------------- | ------------------------------------------- | | string | string | The string to safely wrap in double quotes. |
Example
import quote from 'string-quote-x';
console.log(quote('hello')); // '"hello"'