Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
A simple JavaScript library for encoding and decoding HTML entities.
npm install htmled
You can also use htmled
directly in the browser via jsDelivr:
<script src="https://cdn.jsdelivr.net/gh/SH20RAJ/htmled@main/htmled.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/htmled/htmled.min.js"></script>
// Import the Library
const htmled = require('htmled');
// Encode HTML Entities
const encoded = htmled.encode(`This is a <b>sample</b> string with some special characters like <>&'`);
console.log('Encoded HTML:', encoded);
// Decode HTML Entities
const decoded = htmled.decode('This is a <b>sample</b> string with some special characters like <>&\'');
console.log('Decoded HTML:', decoded);
If you're using htmled
directly in the browser, it will be available as a global variable htmled
.
<script src="https://cdn.jsdelivr.net/gh/SH20RAJ/htmled@main/htmled.min.js"></script>
<script>
// Encode HTML Entities
const encoded = htmled.encode(`This is a <b>sample</b> string with some special characters like <>&'`);
console.log('Encoded HTML:', encoded);
// Decode HTML Entities
const decoded = htmled.decode('This is a <b>sample</b> string with some special characters like <>&\'');
console.log('Decoded HTML:', decoded);
</script>
htmled.encode(html)
html
: The HTML string to encode.Returns the encoded HTML string with HTML entities replaced.
htmled.decode(html)
html
: The HTML string to decode.Returns the decoded HTML string with HTML entities converted back to characters.
const htmled = require('htmled');
// Encode HTML
const encoded = htmled.encode(`<p>This is a <b>bold</b> statement.</p>`);
console.log('Encoded HTML:', encoded);
// Decode HTML
const decoded = htmled.decode('<p>This is a <b>bold</b> statement.</p>');
console.log('Decoded HTML:', decoded);
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A simple JavaScript library for encoding and decoding HTML entities.
We found that htmled demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.