Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v0.0.3
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (12 sloc) 0.396 kb

esc allows you to quickly escape HTML strings. It is capable of automatically extending URLs in the HTML for use in feeds.


var esc = require('esc');

var html = '<a href="../some.html">link</a>';
console.log(esc(html, { uri: '' }));

This will print:

&lt;a href=&quot;;&gt;
Jump to Line
Something went wrong with that request. Please try again.