✨ Buk
encode, decode, filter, skip, quotes, wrap, HTML special chars

$ npm i buk --save
Usage
import { skipQuotes } from 'buk';
var { skipQuotes } = require('buk');
Or include it via jsDelivr CDN:
<script src="https://cdn.jsdelivr.net/npm/buk@1.1.2/build/index.min.js"></script>
access via object : buk
Example : buk.skipHTML("<scrip>hello world</script>living<br />")
// hello worldliving
Methods & Examples
- encodeHTML(String): String|Error
chars to encode : < ' ' " " & >
encodeHTML("<scrip>hello world</script>")
- decodeHTML(String): String|Error
chars to decode : < ' ' " " & >
decodeHTML("<div>hello world</div>")
- skipHTML(String): String|Error
skipHTML("<scrip>hello world</script>living<br />")
- skipQuotes(String): String|Error
chars to skip : ' ' " "
skipQuotes("doesn't and what's")
- rmBackSlashes(String): String|Error
rmBackSlashes("doesn\\'t what\\\\'s \\")
- wrap(String, Object): String
wrap("hello world", { ws: "<div>", we: "</div>" })
wrap("hello world", { ws: "", we: "" })
wrap("hello world", { ws: "", we: "</br>" })
Notes
- Works both in Node.js and in the browser.
- All pull requests are welcome, feel free.
License
MIT