# async-tag

> Resolves template literals tag values before applying a generic tag

Latest version **0.2.0** (published 2020-12-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install async-tag
pnpm add async-tag
yarn add async-tag
bun add async-tag
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2020-12-31 |
| First published | 2020-12-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Andrea Giammarchi |
| Maintainers | webreflection |
| Keywords | async, template, literal, tag, values |

## Links

- npm: https://www.npmjs.com/package/async-tag
- Repository: https://github.com/WebReflection/async-tag
- Homepage: https://github.com/WebReflection/async-tag#readme
- Issues: https://github.com/WebReflection/async-tag/issues
- npm.io page: https://npm.io/package/async-tag

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2020-12-31
- 0.1.3 — 2020-12-31
- 0.1.2 — 2020-12-31
- 0.1.1 — 2020-12-30
- 0.1.0 — 2020-12-30
- 0.0.1 — 2020-12-30
- 0.0.0 — 2020-12-30

## README

# async-tag

[![Build Status](https://travis-ci.com/WebReflection/async-tag.svg?branch=main)](https://travis-ci.com/WebReflection/async-tag) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/async-tag/badge.svg?branch=main)](https://coveralls.io/github/WebReflection/async-tag?branch=main)

<sup>**Social Media Photo by [Tobias Rademacher](https://unsplash.com/@tobbes_rd) on [Unsplash](https://unsplash.com/)**</sup>

Resolves template literals tag values before applying a generic tag.

```js
import asyncTag from 'async-tag';
// or const asyncTag = require('asyncTag');
// or <script src="//unpkg.com/async-tag">

// example
const asyncRaw = asyncTag(String.raw);

// async values
asyncRaw`a${[
  1,
  [2, [Promise.resolve(3)], 4],
  [5, 6]
]}${Promise.resolve(7)}c`
  .then(result => {
    console.assert(result === 'a1,2,3,4,5,67c')
  });

// direct values
asyncRaw`a${'b'}c`
  .then(result => {
    console.assert(result === 'abc')
  });
```

### Compatibility

This [module source code](./esm/index.js) is written in a way that guarantees there won't be any code bloat once transpiled, without necessarily providing worse performance than native ES6+.

Both [index.js](./index.js) and [min.js](./min.js) target any client/server JavaScript engine, assuming there is support, or there is a polyfill, for:

  * `Array.isArray(any)` to work with nested interpolations
  * `Promise.all(array)` to resolve all interpolations
  * `Function.prototype.bind` to be sure both context and template are expected

Please note this module is pretty much done so, if there are not many updates in the long term, it's because it's 100% code covered and, for what it does, it won't likely need any change in the future.

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