escape-html
Escape string for use in HTML
Last updated 5 years ago by dougwilson .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install escape-html 
SYNC missed versions from official npm registry.

escape-html

Escape string for use in HTML

Example

var escape = require('escape-html');
var html = escape('foo & bar');
// -> foo & bar

Benchmark

$ npm run-script bench

> escape-html@1.0.3 bench nodejs-escape-html
> node benchmark/index.js


  http_parser@1.0
  node@0.10.33
  v8@3.14.5.9
  ares@1.9.0-DEV
  uv@0.10.29
  zlib@1.2.3
  modules@11
  openssl@1.0.1j

  1 test completed.
  2 tests completed.
  3 tests completed.

  no special characters    x 19,435,271 ops/sec ±0.85% (187 runs sampled)
  single special character x  6,132,421 ops/sec ±0.67% (194 runs sampled)
  many special characters  x  3,175,826 ops/sec ±0.65% (193 runs sampled)

License

MIT

Current Tags

  • 1.0.3                                ...           latest (5 years ago)

5 Versions

  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 0.0.1                                ...           8 years ago
Maintainers (1)
Downloads
Today 8,094
This Week 211,354
This Month 852,482
Last Day 13,807
Last Week 218,097
Last Month 711,083
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1102)

Copyright 2014 - 2017 © taobao.org |