# glslify-fancy-imports

> glslify transform that provides you with a cleaner module import/export syntax ✨

Latest version **1.0.1** (published 2015-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install glslify-fancy-imports
pnpm add glslify-fancy-imports
yarn add glslify-fancy-imports
bun add glslify-fancy-imports
```

## 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.1 |
| Published | 2015-12-06 |
| First published | 2015-12-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Hugh Kennedy |
| Maintainers | hughsk |
| Keywords | ecosystem:stackgl |

## Links

- npm: https://www.npmjs.com/package/glslify-fancy-imports
- Repository: https://github.com/stackgl/glslify-fancy-imports
- Issues: https://github.com/stackgl/glslify-fancy-imports/issues
- npm.io page: https://npm.io/package/glslify-fancy-imports

## Dependencies (2)

- [glsl-tokenizer](https://npm.io/package/glsl-tokenizer.md) ^2.0.2
- [glsl-token-string](https://npm.io/package/glsl-token-string.md) ^1.0.1

## Recent versions

- 1.0.1 (latest) — 2015-12-06
- 1.0.0 — 2015-12-06

## README

# glslify-fancy-imports

[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

glslify transform that provides you with a cleaner module import/export syntax ✨

May eventually be available in glslify directly, but using this for people to try out and express opinions. Regardless, the old syntax will still be available for backwards compatibility.

## Setup

[![NPM](https://nodei.co/npm/glslify-fancy-imports.png)](https://www.npmjs.com/package/glslify-fancy-imports)

After installing, you can include this as a local transform from the CLI like to enable:

``` bash
glslify index.glsl -t glslify-fancy-imports
```

Alternatively you can add the transform by adding `glslify.transform` to your `package.json` file:

``` json
{
  "name": "my-package",
  "dependencies": {
    "glslify": "^4.0.0",
    "glslify-fancy-imports": "^1.0.0"
  },
  "glslify": {
    "transform": [
      "glslify-fancy-imports"
    ]
  }
}
```

## Usage

Right now the fancy import syntax is just sugar on top of the existing syntax, e.g. the following:

``` glsl
import z from './test'
import y from './test' where { map1 = source2, map2 = source1 }
import x from './test' where {
  map1 = source1,
  map2 = source2
}

export w
```

Gets converted into:

``` glsl
#pragma glslify: z = require('./test')
#pragma glslify: y = require('./test', map1 = source2, map2 = source1)
#pragma glslify: x = require('./test', map1 = source1, map2 = source2)

#pragma glslify: export(w)
```

The key difference is that there's no more `#pragma glslify:`. The imports/exports have their own glslify-specific language syntax (for better, or for worse).

You'll also notice that you can now declare your module name mappings over multiple lines, which is handy for packages that require a lot of configuration this way.

## Contributing

See [stackgl/contributing](https://github.com/stackgl/contributing) for details.

## License

MIT. See [LICENSE.md](http://github.com/stackgl/glslify-fancy-imports/blob/master/LICENSE.md) for details.

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