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

ethsset

v1.2.3

Published

Node.js based Asset Pipeline

Downloads

1

Readme

ethsset

ethsset is a node.js+Ninja based Asset Pipeline.

[TOC]

Installation

ethsset is best being installed globally if used for command-line. ninja has to be installed on your computer, either by npm or "normally" and be in your PATH.

Usage

ethsset requires an ethsset.json in its executed directory. If no ethsset.json exists ethsset will create an default one for you on first call. The ethsset.json has the following structure:

{
    ninja?: {
        version?: string;
        buildpath?: string; | 'ethsset_build'
        buildfile?: string; | 'build.ninja'
    };
    rules: rule[];
    edges: edge[];
    globedges?: glob_edge[];
}

Anything marked with ? is an optional parameter. The default value if any is described with | value. For example: You can specify the version of Ninja atleast required, but it is purely optional.

Testing ethsset

You can test your configuration by using the ethsset test command. This will perform a dry run on ninja executing no actual tasks but providing the same output as if run normally.

Ninja Configuration (ninja)

{
	version?: string,
    buildpath?: string; | 'ethsset_build'
    buildfile?: string; | 'build.ninja'
}

version defines the version of ninja required by the executed system. buildpath defines in which folder the ninja will place its files relative to the executed directory. buildfile defines the output file name of ninja.

Rules (rules[ ])

A rule contains of a name, a command and an optional description. The description is generated if none is provided in the pattern of [<name>] <cmd>

{
	name: string;
	cmd: string;
	desc?: string; | '[<name>] <cmd>'
}

A simple copy rule would look like this:

rules: [
    { name: 'copy', 'cmd': 'cp $in $out', 'desc': 'copy $in to $out'},
    { name: 'copy-if-notexist', 'cmd': 'cp -n $in $out', 'desc': 'copy $in to $out'}
]

This uses ninja-build syntax so use $in for input file placement and $out for output file placement.

Edges (edges[ ])

An edge provides a single task for ethsset.

{
	to: string;
    from: string;
    rule: string;
}

For a given project structure

ethsset.json
bin/
src/
raw_assets/
	default.cfg

A sample rule to copy the default.cfg to bin/ if non-existend in bin/ would be (according to the rules from above)

{ 'from': 'raw_assets/some_asset.ast', 'to': 'bin/default.cfg, 'rule': 'copy-if-notexist' }

GlobEdges (glob_edges[ ])

GlobEdges are another way to define tasks. These task use the globule module and allow to match a single task to a specific file pattern.

{
    rule: string;
    pattern: string;
    srcBase?: string; | ''
    destBase?: string; | ''
    flatten?: boolean; | false
    ext?: string; | ''
}

Most of the parameters are named the same as in globule documentation. rule is the name of the rule previously defined.

An example globedge is:

    { "pattern": "*.png", "srcBase": "raw_assets", "destBase": "assets", "rule": "copy", "ext": ".picture" }

It copies all png-Files from ./raw_assets/ to assets and changing their file-extension to .picture.