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

string-raw

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-raw

a ponyfill for the ES6 String.raw()

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18K
increased by22.34%
Maintainers
1
Weekly downloads
 
Created
Source

String Raw

Installation

npm install string-raw --save

Usage

It behaves just as String.raw.

const stringRaw = require('string-raw');

const arg1 = 'foo';
const arg2 = 'bar';

stringRaw``; // ""
stringRaw`hoge`; // "hoge"
stringRaw`hoge${arg1}`; // "hogefoo"
stringRaw`hoge${arg1}fuga${arg2}`; // hogefoofugabar
stringRaw`hoge${arg1}fuga${arg2}piyo`; // hogefoofugabarpiyo

stringRaw({ raw: [] }, arg1, arg2); // ""
stringRaw({ raw: ['hoge'] }, arg1, arg2); // "hoge"
stringRaw({ raw: ['hoge', 'fuga'] }, arg1, arg2); // "hogefoofuga"
stringRaw({ raw: ['hoge', 'fuga', 'piyo'] }, arg1, arg2); // "hogefoofugabarpiyo"

stringRaw({ raw: {} }, arg1, arg2); // ""
stringRaw({ raw: true }, arg1, arg2); // ""

stringRaw(); // TypeError: Cannot convert undefined or null to object
stringRaw(''); // TypeError: Cannot convert undefined or null to object
stringRaw(null); // TypeError: Cannot convert undefined or null to object
stringRaw({ raw: null }); // TypeError: Cannot convert undefined or null to object

Development

Requirement global

  • NodeJS v5.10.0
  • Npm v3.8.3
git clone https://github.com/59naga/string-raw
cd string-raw
npm install

npm test

License

MIT

Keywords

FAQs

Package last updated on 05 Apr 2016

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