Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-html-encoder

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-html-encoder

Package for encoding and decoding html string

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-html-encoder

NodeJS wrapper for JavaScript HTML Encoder library http://www.strictly-software.com/htmlencode

Install

npm install node-html-encoder

Examples

var Encoder = require('node-html-encoder').Encoder;

// entity type encoder
var encoder = new Encoder('entity');

console.log(encoder.htmlEncode('<foo /> "bar"'))
// prints &lt;foo /&gt; &quot;bar&quot;

console.log(encoder.htmlDecode('&lt;foo /&gt; &quot;bar&quot;'))
// prints <foo /> "bar"

// numerical type encoder
encoder = new Encoder('numerical');

console.log(encoder.htmlEncode('<foo /> "bar"'))
// prints &#60;foo /&#62; &#34;bar&#34;

console.log(encoder.htmlDecode('&#60;foo /&#62; &#34;bar&#34;'))
// prints <foo /> "bar"

Keywords

FAQs

Package last updated on 08 Feb 2013

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc