# string-raw

> a ponyfill for the ES6 String.raw()

Latest version **1.0.1** (published 2016-04-05) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install string-raw
pnpm add string-raw
yarn add string-raw
bun add string-raw
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-04-05 |
| First published | 2016-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | 59naga |
| Maintainers | 59naga |
| Keywords | String.raw, ponyfill, polyfill |

## Links

- npm: https://www.npmjs.com/package/string-raw
- Repository: https://github.com/59naga/string-raw
- Homepage: https://github.com/59naga/string-raw#readme
- Issues: https://github.com/59naga/string-raw/issues
- npm.io page: https://npm.io/package/string-raw

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-04-05
- 1.0.0 — 2016-04-02

## README

String Raw
---

<p align="right">
  <a href="https://npmjs.org/package/string-raw">
    <img src="https://img.shields.io/npm/v/string-raw.svg?style=flat-square">
  </a>
  <a href="https://travis-ci.org/59naga/string-raw">
    <img src="http://img.shields.io/travis/59naga/string-raw.svg?style=flat-square">
  </a>
  <a href="https://codeclimate.com/github/59naga/string-raw/coverage">
    <img src="https://img.shields.io/codeclimate/github/59naga/string-raw.svg?style=flat-square">
  </a>
  <a href="https://codeclimate.com/github/59naga/string-raw">
    <img src="https://img.shields.io/codeclimate/coverage/github/59naga/string-raw.svg?style=flat-square">
  </a>
  <a href="https://gemnasium.com/59naga/string-raw">
    <img src="https://img.shields.io/gemnasium/59naga/string-raw.svg?style=flat-square">
  </a>
</p>

Installation
---
```bash
npm install string-raw --save
```

Usage
---
It behaves just as [String.raw](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/raw).

```js
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

```bash
git clone https://github.com/59naga/string-raw
cd string-raw
npm install

npm test
```

License
---
[MIT](http://59naga.mit-license.org/)

---
_Source: https://npm.io/package/string-raw · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
