Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/romac/node-houdini
Node.js bindings for Houdini, a text escaping library by GitHub (ABANDONED)
https://github.com/romac/node-houdini
Last synced: 8 days ago
JSON representation
Node.js bindings for Houdini, a text escaping library by GitHub (ABANDONED)
- Host: GitHub
- URL: https://github.com/romac/node-houdini
- Owner: romac
- Created: 2013-04-18T01:34:23.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-19T15:32:19.000Z (over 11 years ago)
- Last Synced: 2024-04-14T07:35:42.376Z (7 months ago)
- Language: C
- Homepage:
- Size: 184 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-houdini [![Dependencies Status](https://david-dm.org/romac/node-houdini.png)](https://david-dm.org/romac/node-houdini)
> Node.js bindings for [Houdini](https://github.com/vmg/houdini), a text escaping library by GitHub.
**Bundled Houdini version:** [e6f0ec96b85578a2fd8ab79af84493cad3a84cfb](https://github.com/vmg/houdini/commit/e6f0ec96b85578a2fd8ab79af84493cad3a84cfb)
From [Houdini's README](https://github.com/vmg/houdini#readme):
Houdini is a simple API for escaping text for the web. And unescaping it. But that kind of breaks the joke in the name so nevermind.
- HTML escaping follows the OWASP suggestion. All other entities are left as-is.
& --> &
< --> <
> --> >
" --> "
' --> ' ' is not recommended
/ --> / forward slash is included as it helps end an HTML entity- HTML unescaping is fully RFC-compliant. Yes, that's the 253 different entities for you, and decimal/hex code point specifiers.
- URI escaping and unescaping is fully RFC-compliant.
- URL escaping and unescaping is the same as generic URIs, but spaces are changed to `+`.
## Installation
$ npm install -g node-gyp
$ npm install houdini## Usage
```js
var houdini = require('houdini');var str = 'A & B > C';
var escaped = houdini.escapeHTML(str); // A & B > C
var unescaped = houdini.unescapeHTML(escaped); // A & B > C
```## Methods
All the methods return the (un)escaped string.
### .escapeHTML(str, secure = false)
### .unescapeHTML(str)
### .escapeXML(str)
### .escapeURL(str)
### .unescapeURL(str)
### .escapeURI(str)
### .unescapeURI(str)
### .escapeHREF(str)
### .escapeJS(str)
### .unescapeJS(str)## License
node-houdini is released under the [MIT license](http://romac.mit-license.org).