entityconvert.js
convert special characters in a string to their HTML or CSS charcode entities (useful for build tools et. al.)
The module works as AMD or CommonJS module and exports an Object containing two functions: .html(str)
and .css(str)
. In a non-AMD or CommonJS environment window.entityconvert
will be exported.
AMD usage like:
require(['entityconvert'], function(entityconvert){
var converted = entityconvert.html('We äll löve Ümläutß!');
});
CommonJS usage like:
var entityconvert = require('entity-convert');
var converted = entityconvert.css('We äll löve Ümläutß!');
Available via npm:
npm install entity-convert --save
##License
MIT © Frederik Ring