# assets-expander

> A well-tested tool for expanding any files structure defined in YAML file into a flat list of files

Latest version **1.0.2** (published 2014-02-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install assets-expander
pnpm add assets-expander
yarn add assets-expander
bun add assets-expander
```

## 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.0.2 |
| Published | 2014-02-27 |
| First published | 2011-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+7 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Jakub Pawlowicz |
| Maintainers | goalsmashers |
| Keywords | css, javascript, assets, yaml |

## Links

- npm: https://www.npmjs.com/package/assets-expander
- Repository: http://github.com/GoalSmashers/assets-expander
- Issues: https://github.com/GoalSmashers/assets-expander/issues
- npm.io page: https://npm.io/package/assets-expander

## Dependencies (1)

- [js-yaml](https://npm.io/package/js-yaml.md) 3.0.x

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2014-02-27
- 1.0.0 — 2014-02-25
- 0.5.0 — 2012-09-06
- 0.4.1 — 2012-08-07
- 0.4.0 — 2012-08-06
- 0.3.1 — 2012-08-02
- 0.3.0 — 2012-07-09
- 0.2.3 — 2012-06-17
- 0.2.2 — 2012-06-17
- 0.2.1 — 2011-04-15
- 0.2.0 — 2011-04-07
- 0.1.2 — 2011-04-05
- 0.1.1 — 2011-04-03
- 0.1.0 — 2011-03-27

## README

[![NPM version](https://badge.fury.io/js/assets-expander.png)](https://badge.fury.io/js/assets-expander)
[![Build Status](https://secure.travis-ci.org/jakubpawlowicz/assets-expander.png)](https://travis-ci.org/jakubpawlowicz/assets-expander)
[![Dependency Status](https://david-dm.org/jakubpawlowicz/assets-expander.png?theme=shields.io)](https://david-dm.org/jakubpawlowicz/assets-expander)
[![devDependency Status](https://david-dm.org/jakubpawlowicz/assets-expander/dev-status.png?theme=shields.io)](https://david-dm.org/jakubpawlowicz/assets-expander#info=devDependencies)

## What is assets-expander?

Assets-expander is a Node.js library that turns a glob-like declarations from YAML file into a list of files.
Just see below for examples.

## Usage

### How to install assets-expander?

```
npm install assets-expander
```

### How to user assets-expander?

```js
var AssetsExpander = require('assets-expander');
var expander = new AssetsExpander('assets.yml', { root: 'path/to/public/dir' });
expander.processGroup('javascripts', 'public'); // gets a flat list of assets in public group
```

### How to define assets.yml file?

Just go with something like:

```yml
javascripts:
  public:
    vendor: 'undescore,modernizr'
    public: '**/*'
stylesheets:
  public:
    - 'reset,shared,base,home'
```

Then if you have the following directory structure:

```
javascripts
  - vendor
    - underscore.js
    - modernizr.js
  - public
    - main.js
    - fallback.js
stylesheets
  - reset.css
  - shared.css
  - base.css
  - home.css
```

then running the following code will give you the files you need:

```
> expander.processGroup('stylesheets', 'public')
> ['stylesheets/reset.css', 'stylesheets/shared.css', 'stylesheets/base.css', 'stylesheets/home.css']

> expander.processGroup('javascripts', 'public')
> ['javascripts/vendor/underscore.js', 'javascripts/vendor/modernizr.js', 'javascripts/public/main.js', 'javascripts/public/fallback.js']
```

## License

Assets-expander is released under the MIT license.

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