1.0.0 • Published 2 years ago

wg-manifest v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

What Guns Manifest Generator

wg-manifest is a script to generate a JSON file containing a manifest of all of the files in a given folder and its subfolders. This is intended for use in loading images and audio into JavaScript/HTML browser games: the game can fetch the manifest, then load all images from the manifest by fetching their paths.

Usage

Generating the manifest

Install this NPM module:

    $ npm install -g wg-manifest 

Pass in the directory on which the manifest should be generated. By default, the manifest will go to standard output:

    $ wg-manifest ./images

To write the manifest to a file, use the -o tag:

    $ wg-manifest -o=imageManifest.json ./images

To restrict the manifest to only certain file extensions, use --audio, --image, or a custom list of extensions with -e;

    $ wg-manifest --audio --image -e=tiff,json ./media

If you have a watch program installed, you can keep the manifest up to date:

    $ watch "wg-manifest -o=imageManifest.json ./images"

Using the manifest

If the manifest is written to a known place, a website could fetch the manifest, then use the file paths to create Image objects to draw to a canvas. An example of this can be found in tsg-boilerplate.

1.0.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago