New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

buk

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buk

encode, decode, filter, skip, quotes, HTML special chars

  • 1.1.0
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

✨ Buk

Snyk badge bundlephobia badge bundlephobia badge

$ npm i buk --save

Usage

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

Or include it via jsDelivr CDN:

<script src="https://cdn.jsdelivr.net/npm/buk@1.1.0/build/index.min.js"></script>

Methods & Examples

  • encodeHTML(String): String|Error
    chars to encode : < '' "" & >
encodeHTML("<scrip>hello world</script>") 
// &lt;scrip&gt;hello world&lt;/script&gt;
  • decodeHTML(String): String|Error
    chars to decode : < '' "" & >
decodeHTML("&lt;scrip&gt;hello world&lt;/script&gt;") 
// <scrip>hello world</script>
  • skipHTML(String): String|Error
skipHTML("<scrip>hello world</script>living<br />") 
// hello worldliving
  • skipQuotes(String): String|Error
    chars to skip : '' ""
skipQuotes("doesn't and what's") 
// doesn\'t and what\'s
  • rmBackSlashes(String): String|Error
rmBackSlashes("doesn\\'t what\\\\'s \\") 
// doesn't what's
  • wrap(String, Object): String
wrap("hello world", { ws: "<div>", we: "</div>" }) // <div>hello world</div>
wrap("hello world", { ws: "", we: "" }) // hello world
wrap("hello world", { ws: "", we: "</br>" }) // hello world</br>

Notes

  • Works both in Node.js and in the browser.
  • All pull requests are welcome, feel free.

License

MIT

Keywords

FAQs

Package last updated on 03 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc