special-escape

0.1.1 • Public • Published

special-escape

Escape special characters in a string

Installation

NPM

special-escape is published at npmjs.com, and can be installed using npm or yarn.

$ npm install special-escape  # npm 
$ yarn add special-escape     # yarn 
import resolveWhen from 'special-escape';       // ES6+
const resolveWhen = require('special-escape');  // ES5

Usage

const specialChars = ['+', '-', '=', '>', '.', '!', '(', ')', '{', '}', '[', ']', '^', '"', '~', '*', '?', ':', '\\', '/',]
 
const escapedString = escapeChars('$2a$10$!NgGQwxmjy..4aQTdsOJw\\O7HUd6FfiFQ2e/2F6XJQh1PeZjWlEbmK', specialChars);
 
assert(escapedString, '$2a$10$\!NgGQwxmjy\.\.4aQTdsOJw\\O7HUd6FfiFQ2e\/2F6XJQh1PeZjWlEbmK');

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    1
  • 0.1.0
    0

Package Sidebar

Install

npm i special-escape

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

2.87 kB

Total Files

5

Last publish

Collaborators

  • d4nyll