# es6ish-string-format

> An ES5 JavaScript string formatter compatible with ES6-style template strings

Latest version **1.0.0** (published 2015-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install es6ish-string-format
pnpm add es6ish-string-format
yarn add es6ish-string-format
bun add es6ish-string-format
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-10-04 |
| First published | 2015-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Cameron McKay |
| Maintainers | cdmckay |

## Links

- npm: https://www.npmjs.com/package/es6ish-string-format
- Repository: https://github.com/process-street/es6ish-string-format
- Homepage: https://github.com/process-street/es6ish-string-format#readme
- Issues: https://github.com/process-street/es6ish-string-format/issues
- npm.io page: https://npm.io/package/es6ish-string-format

## Recent versions

- 1.0.0 (latest) — 2015-10-04

## README

# ES6-ish String formatter

An JavaScript string formatter that is mostly compatible with [ES6 template strings](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/template_strings).

## Installation

In a browser:

```html
<script src="format.js"></script>
```

Via [bower](http://bower.io/):

```bash
bower install es6ish-string-format
```

## Notes

This method will attach itself to the String prototype. That means that once you include it, you can use it like this:

```javascript
var test = 'test';
console.log('this is a ${test}'.format({ test: test }));
// = 'this is a test'
```

It can also access object attributes, like so:

```javascript
var user = { username: 'cdmckay' };
console.log('hello, ${user.username}'.format({ user: user }));
// = 'hello, cdmckay'
```

This format method was designed to have a migration path to ES6 template strings. So, if you wanted to convert
the above example to an ES6 template string, simple replace the quotes with backticks and delete the `.format(...)` part:

```javascript
var user = { username: 'cdmckay' };
console.log(`hello, ${user.username}`);
// = 'hello, cdmckay'
```

## Author

| [![twitter/cdmckay](https://gravatar.com/avatar/b181c028e6b51d408450e12ab68bf25c?s=70)](https://twitter.com/cdmckay "Follow @cdmckay on Twitter") |
|---|
| [Cameron McKay](https://cdmckay.org/) |

## License

This library is available under the [MIT](http://opensource.org/licenses/mit-license.php) license.

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