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

entity-escape

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

entity-escape

A really simple library to escape/unescape pesky HTML entities like ♦ or ♦ to 💎

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Escape HTML entities like ♦ or ♦ to 💎

Use in either nodejs or the browser. It's really simple and works pretty fast.

Installation

Browser 🌎 : https://cdn.jsdelivr.net/npm/entity-escape@latest/index.min.js

Node.js 🛠 : npm install --save entity-escape

Usage

Browser:

var text1 = Entities.unescape('The big & and sparkly diamond ( almost ) glittered in the dark.');

var text2 = Entities.escape('This is a diamond ♦, watch it ◊');

console.log(text1,text2);

Node.js:

const Entities = require('entity-escape');

var text1 = Entities.unescape('The big & and sparkly diamond ( almost ) glittered in the dark.');

var text2 = Entities.escape('This is a diamond ♦, watch it ◊');

console.log(text1,text2);

Methods and Options

Entities.unescape(text,options); //options are {silent:false(default on node, true default on browser),replaceNumbers:true(true default on node, replaces numbered entities even if no names are present)}

Entities.escape(text,options); //options are {silent:false(default on node, true default on browser)}

In case {silent:true} no output is rendered to the console. In case replaceNumbers:false only those characters which are explicitly named HTML entities will be replaced.

Keywords

FAQs

Package last updated on 14 Jul 2018

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