New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

hecon

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hecon

HTML Entity Converter

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

HTML Entity Converter

⚙️ Installation

npm i hecon

CDN Links:

  • https://www.unpkg.com/hecon@1.0.0/hecon.js
  • https://cdn.jsdelivr.net/npm/hecon@1.0.0/hecon.js

📘 Documentation

⇒ Import hecon

ES6

import hecon from 'hecon';

commonjs

const hecon = require('hecon');

⇒ Encode string to HTML entity

console.log(hecon.encode('< Hello />'));

output:

&#60;&#32;&#72;&#101;&#108;&#108;&#111;&#32;&#47;&#62;

⇒ Encode string to HTML entity (Type - 2)

console.log(hecon.encode('< Hello />', true));

output:

&#60; Hello &#47;&#62;

⇒ Decode HTML entity from string

console.log(hecon.decode('&#60; Hello &#47;&#62;'));
console.log(hecon.decode('&#60;&#32;&#72;&#101;&#108;&#108;&#111;&#32;&#47;&#62;'));

output:

< Hello />

Support me on Patreon - Check out my socials

Keywords

hecon

FAQs

Package last updated on 18 Apr 2023

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