# carlton

> Carlton.js ========== For certain use cases it'd be nice to have *lazy* evaluation of template literals, that's what this does.

Latest version **0.0.1** (published 2022-02-01) · 0 weekly downloads

## Install

```sh
npm install carlton
pnpm add carlton
yarn add carlton
bun add carlton
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2022-02-01 |
| First published | 2022-02-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | khrome |

## Links

- npm: https://www.npmjs.com/package/carlton
- npm.io page: https://npm.io/package/carlton

## Dependencies (3)

- [chai](https://npm.io/package/chai.md) ^4.3.6
- [mocha](https://npm.io/package/mocha.md) ^9.2.0
- [es6-template-strings](https://npm.io/package/es6-template-strings.md) ^2.0.1

## Recent versions

- 0.0.1 (latest) — 2022-02-01

## README

Carlton.js
==========
For certain use cases it'd be nice to have *lazy* evaluation of template literals, that's what this does.

let's take this example:

```js
    let state = {error:{}};
    let error_messages = {
        'err404' : `Page not found: ${state.error.message}`
    }
    setTimeout(()=>{
        state.error = {message:"foo"};
        console.log(error_messages.err404);
    });
```
which results in:

```bash
    Page not found: undefined
```

Now, let's alter it to use carlton:

```js
    const carlton = require('carlton');
    let state = {error:{}};
    let error_messages = carlton({
        'err404' : 'Page not found: ${error.message}'
    }, state);
    setTimeout(()=>{
        state.error = {message:"foo"};
        console.log(error_messages.err404);
    });
```
which results in:

```bash
    Page not found: foo
```

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