# @peasy-lib/peasy-assets

> An easy peasy assets library.

Latest version **0.2.6** (published 2023-11-06) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install @peasy-lib/peasy-assets
pnpm add @peasy-lib/peasy-assets
yarn add @peasy-lib/peasy-assets
bun add @peasy-lib/peasy-assets
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.6 |
| Published | 2023-11-06 |
| First published | 2023-02-06 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.17.0 |
| Dependencies | 0 |
| Unpacked size | 36.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jürgen Wenzel |
| Maintainers | jwenzel |

## Links

- npm: https://www.npmjs.com/package/@peasy-lib/peasy-assets
- Repository: https://github.com/peasy-lib/peasy-assets
- Homepage: https://github.com/peasy-lib/peasy-assets#readme
- Issues: https://github.com/peasy-lib/peasy-assets/issues
- npm.io page: https://npm.io/package/@peasy-lib/peasy-assets

## Recent versions

- 0.2.6 (latest) — 2023-11-06
- 0.2.5 — 2023-07-14
- 0.2.4 — 2023-05-15
- 0.2.3 — 2023-02-19
- 0.2.2 — 2023-02-12
- 0.2.1 — 2023-02-06
- 0.2.0 — 2023-02-06

## README

# Peasy Assets

This is the repository for Peasy Assets, a small-ish and relatively easy to use assets library.

## Introduction

Peasy Assets provides assets handling that maps asset names to (pre)loaded assets.

## First look

```ts
import { Assets } from '@peasy-lib/peasy-assets';

Assets.initialize({ src: '/public/assets/' }); // Not necessary, but shortens future paths

await Assets.load([ 'cat.png', { src: 'mouse.jpg', name: 'cat-food' }, 'miao.wav' ]);

const catImage = Assets.image('cat'); // A HTMLImageElement ready to use
const catFood = Assets.image('cat-food'); // A HTMLImageElement ready to use
const catAudio = Assets.audio('miao'); // A HTMLAudioElement ready to use
```
<!-- TODO: Finish examples above -->

## Getting started

If you've got a build process and are using npm, install Peasy Assets with

    npm i @peasy-lib/peasy-assets

and `import` it into whichever files you want to use it

```ts
import { Assets } from '@peasy-lib/peasy-assets';
```

If you don't have a build process or don't want to install it, use a `script` tag

```html
<script src="https://unpkg.com/@peasy-lib/peasy-assets">
```
to make `Assets` available.

## Development and contributing

If you're interested in contributing, please see the [development guidelines](DEVELOPMENT.md).

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