# ase2stylus

> Convert ase (Adobe Swatch Exchange) to stylus files with color variables

Latest version **0.0.2** (published 2014-11-24) · apache2 license · 0 weekly downloads

## Install

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

Provides the command `ase2stylus`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-11-24 |
| First published | 2014-11-24 |
| Weekly downloads | 0 |
| License | apache2 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | erikzaadi |
| Maintainers | erikzaadi |
| Keywords | ace, adobe, stylus |

## Links

- npm: https://www.npmjs.com/package/ase2stylus
- Repository: https://github.com/erikzaadi/ase2stylus
- Issues: https://github.com/erikzaadi/ase2stylus/issues
- npm.io page: https://npm.io/package/ase2stylus

## Dependencies (5)

- [mustache](https://npm.io/package/mustache.md) ^0.8.2
- [commander](https://npm.io/package/commander.md) ^2.5.0
- [minimatch](https://npm.io/package/minimatch.md) ^1.0.0
- [underscore](https://npm.io/package/underscore.md) ^1.7.0
- [adobe-swatch-exchange](https://npm.io/package/adobe-swatch-exchange.md) 0.0.0

## Recent versions

- 0.0.2 (latest) — 2014-11-24
- 0.0.1 — 2014-11-24

## README

## ase2stylus

[![Build Status](https://travis-ci.org/erikzaadi/ase2stylus.svg)](https://travis-ci.org/erikzaadi/ase2stylus)

### Convert ase (Adobe Swatch Exchange) to stylus files with color variables

#### Installation

```bash
npm i [-g] ase2stylus
```

### Usage

#### CLI

```bash
ase2stylus --help

  Usage: ase2stylus [options]

  Options:

    -h, --help             output usage information
    -V, --version          output the version number
    -i, --input [input]    path to ase file (defaults to stdin)
    -o, --output [output]  path to save rendered stylus (defaults to stout)
    -f, --filter [filter]  optional swatch name filter, E.g 'myPrefix*' (minimatch)
```

Will create the following stylus file:

```stylus
swatchName = #FA44AA
```

#### From source

```javascript
var ase2stylus = require('ase2stylus');
var fs = require('fs');

var aseFileContent = fs.readFileSync("/path/to/file.ase"); //notice not utf-8, raw

var renderedStylus = ase2stylus.render(aseFileContent);

//or save directly

ase2stylus.save(aseFileContent, "./path/to/target.styl");

//save and render optionally excepts a filter function for the swatch name
ase2stylus.render(aseFileContent, function(colorName){
  return colorName.indexOf("myPrefix") == 0;
});
```

### Methods

#### render(aseFileContent, optionalFilterStringOrFunction)

##### aseFileContent
ase file raw (not utf-8 string) content

##### optionalFilterStringOrFunction
either [minimatch](https://www.npmjs.org/package/minimatch) compatible string or a predicate function

E.g ```"myPrefix*"```

Or as a predicate function:

```javascript
function(colorName){
  //return true to include this in rendered stylus
  return colorName.startswith("myPrefix");
}
```

#### save(aseFileContent, stylusOutputPath, optionalFilterStringOrFunction)

##### aseFileContent

As in render method

##### stylusOutputPath

path to save rendered stylus

##### optionalFilterStringOrFunction

As in render method

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