# as-inliner

> Inlines files into your AssemblyScript

Latest version **0.0.3** (published 2021-03-23) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install as-inliner
pnpm add as-inliner
yarn add as-inliner
bun add as-inliner
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2021-03-23 |
| First published | 2021-03-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 19.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Author | Surma |
| Maintainers | surma |

## Links

- npm: https://www.npmjs.com/package/as-inliner
- Repository: https://github.com/surma/as-inliner
- Homepage: https://github.com/surma/as-inliner#readme
- Issues: https://github.com/surma/as-inliner/issues
- npm.io page: https://npm.io/package/as-inliner

## Dependencies (1)

- [visitor-as](https://npm.io/package/visitor-as.md) ^0.4.0

## Recent versions

- 0.0.3 (latest) — 2021-03-23
- 0.0.2 — 2021-03-20

## README

# as-inliner

`as-inliner` allows you to inline the contents of a file into your [AssemblyScript]. This all happens at build time as either a `string` or a `StaticArray`.

## Example & Documentation

```ts
const image: StaticArray<u8> = Inliner.inlineFileAsStaticArray(
  "../images/hero.png"
);
const welcomeText: string = Inline.inlineFileAsString("../README.md");

export function main(): void {
  /* ... */
}
```

It’s worth nothing that inlining a file as a string will assume that the file is encoded in UTF-8 and will put it into linear memory in WTF-16, taking up ~twice as much space (but gzip compression will negate most of that).

## Usage

`as-inliner` works through [ASC transforms][transforms]:

```
$ npx asc -b your/output/path/file.wasm --transform as-inliner -O3
```

or place it in your `asconfig.json`:

```json
{
  ...
  "options": {
    "transform": ["as-inliner"]
  }
}
```

Or extend the `asconfig.json` here:

```json
{
  "extend": "as-inliner/asconfig.json"
}
```

---

License Apache-2.0

[assemblyscript]: https://www.assemblyscript.org/
[transforms]: https://www.assemblyscript.org/transforms.html#transforms

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