# nanami

> An iterator for dynamic substituion on string pattern

Latest version **1.3.0** (published 2019-10-29) · ISC license · 0 weekly downloads

## Install

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

## 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.3.0 |
| Published | 2019-10-29 |
| First published | 2016-11-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 42 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | shiraishimai |

## Links

- npm: https://www.npmjs.com/package/nanami
- Repository: https://github.com/shiraishimai/nanami
- Homepage: https://github.com/shiraishimai/nanami#readme
- Issues: https://github.com/shiraishimai/nanami/issues
- npm.io page: https://npm.io/package/nanami

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) *

## Recent versions

- 1.3.0 (latest) — 2019-10-29
- 1.2.1 — 2017-05-06
- 1.2.0 — 2017-04-03
- 1.1.0 — 2017-01-01
- 1.0.3 — 2016-12-12
- 1.0.2 — 2016-12-11
- 1.0.1 — 2016-11-02

## README

# Nanami

An iterator for dynamic substituion on string pattern

  - No more unreadable RegExp
  - Easy hook with static Integer/Char generator
  - Loop of loop of loop....

### Example

Single Iteration:
```js
var Nanami = require("nanami");
for (let result of new Nanami("This is loop {x}", Nanami.integerGenerator(5))) {
    console.log(result);
}
/** Results:
This is loop 0
This is loop 1
This is loop 2
This is loop 3
This is loop 4
**/
```

Double Iteration:
```js
var Nanami = require("nanami");
for (let result of new Nanami("This is {a} double loop {x}", Nanami.charGenerator(2), Nanami.integerGenerator(3, 1))) {
    console.log(result);
}
/** Results:
This is a double loop 1
This is a double loop 2
This is a double loop 3
This is b double loop 1
This is b double loop 2
This is b double loop 3
**/
```

Iteration inspection:
```js
var Nanami = require("nanami");
let nanamin = new Nanami(
        "file://{a}{x}.dat", 
        Nanami.charGenerator(2, 'm'), 
        Nanami.integerGenerator(3, 1)
    );
nanamin.each((result, a, x) => {
    console.log(`${result} \ta=${a}\tx=${x}`);
});
/** Results:
file://m1.dat 	a=m	x=1
file://m2.dat 	a=m	x=2
file://m3.dat 	a=m	x=3
file://n1.dat 	a=n	x=1
file://n2.dat 	a=n	x=2
file://n3.dat 	a=n	x=3
**/
```

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