0.0.1-alpha.1 • Published 1 year ago

buk v0.0.1-alpha.1

Weekly downloads
8
License
ISC
Repository
-
Last release
1 year ago

✨ Buk

encode, decode, filter, skip, HTML special chars

npm.io Snyk badge bundlephobia badge bundlephobia badge

$ npm i buk --save

Usage

import { encodeHTML } from 'buk';
// or
var { encodeHTML } = require('buk');

Or include it via jsDelivr CDN:

<script src="https://cdn.jsdelivr.net/npm/buk@1.2.2/index.min.js"></script>
access via object : buk
Example : buk.skipHTML("<scrip>hello world</script>living<br />") 
// hello worldliving

Methods & Examples

  • encodeHTML(String): String|TypeError
    *chars to encode : & < > " ' @ + / `
encodeHTML("<scrip>hello world</script>") 
// &lt;scrip&gt;hello world&lt;&sol;script&gt;
  • decodeHTML(String): String|TypeError
    *chars to decode : & < > " ' @ + / `
decodeHTML("&lt;scrip&gt;hello world&lt;&sol;script&gt;") 
// <div>hello world</div>
  • skipHTML(String): String|TypeError
skipHTML("<scrip>hello world</script> 2019<br />") 
// hello world 2019

Notes

  • TypeError : Invalid type or no argument passed to function.
  • Works both in Node.js and in the browser.
  • All pull requests are welcome, feel free.

License

MIT

0.0.1-alpha.1

1 year ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago