npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

openraster-export

v1.3.1

Published

A tool to programatically export ORA files into images based on their layers.

Downloads

4

Readme

OpenRaster Export

This will flatten an ORA file into a single image file, with the ability to limit the layers included in the output.

Install

npm install openraster-export

Usage

const OpenRasterExport = require("openraster-export").default;
OpenRasterExport("C:/path/to/file.ora", {
    includeLayers: ["layer1", "layer2"]
}).then(b64 => ...);

API

OpenRasterExport(imagepath, [options])

Returns a Promise which resolves to a base64 data URI

imagepath

Type: string

Path to an ORA file. Currently only ORA files with one stack and any number of layers is supported.

options

Type: option

You can use either includeLayers and/or includeRegex, or you can use either excludeLayers and/or excludeRegex, but you cannot mix includes and excludes. If set, excludeHidden will take priority over any includeLayers/includeRegex rules.

Gamer Pro-Tip: Do not use the g flag on RegExps passed to includeRegex or excludeRegex (use /^something$/, not /^something$/g) or things will fail in weird ways. I promise it's not my fault.

options.excludeHidden

Type: boolean Default: false

If true, all hidden layers (layer visibility='hidden') will be excluded from the exported image.

options.includeLayers

Type: string[] Default: undefined

List of layers - by name - to include in the exported image. Case sensitive.

options.includeRegex

Type: RegExp Default: undefined

A regular expression that, if a layer name matches, will include that layer in the exported image.

options.excludeLayers

Type: string[] Default: undefined

List of layers - by name - to exclude from the exported image. Case sensitive.

options.excludeRegex

Type: RegExp Default: undefined

A regular expression that, if a layer name matches, will exclude from layer in the exported image.

options.shrink

Type: boolean Default: false

If true, the resulting image will be the smallest size that fits all layers, instead of the size of the ORA canvas.

options.mergeImageOptions

Type: mergeImages.Options Default: undefined

merge-image Options. If you specify Canvas and Image options, your specified values will be used, otherwise a Canvas and Image will be provided.

Contributing

Sure.

License

Code is licensed under the GNU Affero General Public License. I am not a lawyer, but what I intend for that to mean is, if you use this to generate images locally or as a dev dependency for something, have fun. If you use it as a standard dependency for your project and its code is included in your app/package/whatever, then you must distribute your work under an AGPL-compatible license.