open-index/open-npm huggingface dataset:
npm package: @ndbx/npseed
Description: Seed: procedural phrase book parser and generator.
Latest version: 0.1.0

# Seed

Procedural Content Generator


## Local development

The app runs as a single-page application, so we use [serve](https://www.npmjs.com/package/serve) to always serve the index.html.

    # Only needed the first time
    npm install -g serve

    # Serve as a single-page application
    serve -s

## Deploy
Do this once:

    npm install -g firebase-tools
    firebase login

Do this every time you want to deploy:

    ./deploy.sh

This will copy all the files over to the _build directory, and a timestamp to the CSS and JS files so we immediately see the latest version.
npm package: @ndbx/seed
Description: Seed: procedural phrase book parser and generator.
Latest version: 0.2.0

# Seed

Procedural Content Generator


## Local development

The app runs as a single-page application, so we use [serve](https://www.npmjs.com/package/serve) to always serve the index.html.

    # Only needed the first time
    npm install -g serve

    # Serve as a single-page application
    serve -s

## Deploy
Do this once:

    npm install -g firebase-tools
    firebase login

Do this every time you want to deploy:

    ./deploy.sh

This will copy all the files over to the _build directory, and a timestamp to the CSS and JS files so we immediately see the latest version.
npm package: @ndcode/clean-css
Description: A well-tested CSS minifier (added NDCODE hooks)
Author: Jakub Pawlowicz
Latest version: 4.2.2

# CSS minifier based on existing NPM package (added NDCODE hooks)

An NDCODE project.

## Overview

This is a minor modification to the NPM `clean-css` package version 4.2.1.
For the complete usage information, please see the original documentation at:
  https://www.npmjs.com/package/clean-css.
We gratefully acknowledge the authors for their MIT-licensing the package.

## Modifications

Suppose this package is imported as
  `let CleanCSS = require('@ndcode/clean-css')`
and then instantiated by
  `let clean_css = new CleanCSS(...)`,
then usually minification is done by calling
  `clean_css.minify(input, maybeSourceMap, maybeCallback)`.

We define a similar function for minifying CSS embedded in other source code,
```js
clean_css.minifyEmbedded(
  input,
  embeddedStart,
  maybeSourceMap,
  maybeCallback
)
```
This makes parsing start at the specified character position `embeddedStart` in
the `input` string, which should be just after an opening `{` character. CSS is
parsed while counting the nesting level of braces, and parsing stops when an
unmatched `}` is encountered. The embedded CSS is then minified as per usual.

Suppose the `minifyEmbedded()` function returns the object `result`, then the
minified CSS is normally accessed as `result.styles`. We define a new field
`result.embeddedEnd` which contains the character position of the `}` that
stopped the parsing. If no unmatched `}` is found, `-1` is returned instead.

Note that passing `embeddedStart == -1` makes `minifyEmbedded()` behave the
same as `minify()`, and that `embeddedEnd == -1` is returned by both `minify()`
and `minifyEmbedded()` in the case that no final `}` was found and/or sought.

The embedded-CSS interface is used by the `jst` (JavaScript Templates) package.

## To be implemented

In the future we may also add separate APIs for parsing and rendering the CSS.
This would have been handy for the current usage, since the `jst` package works
by parsing, transforming, and then rendering the source code tree, but for now
it was simpler just to minify the CSS completely to a string during parsing.

## GIT repository

The development version can be cloned, downloaded, or browsed with `gitweb` at:
https://git.ndcode.org/public/clean-css.git

## License

All of our NPM packages are MIT licensed, please see LICENSE in the repository.

## Contributions

Feedback on NDCODE packages and/or code contributions are gratefully welcomed.

Contact: Nick Downing <nick@ndcode.org>
npm package: @ndcode/html-minifier
Description: Highly configurable, well-tested, JavaScript-based HTML minifier (added NDCODE hooks)
Author: Juriy "kangax" Zaytsev
Latest version: 3.5.22

# HTML minifier based on existing NPM package (added NDCODE hooks)

An NDCODE project.

## Overview

This is a minor modification to the NPM `html-minifier` package version 3.5.21.
For the complete usage information, please see the original documentation at:
  https://www.npmjs.com/package/html-minifier.
We gratefully acknowledge the authors for their MIT-licensing the package.

## Modifications

We've changed the `uglify-js` dependency to `uglify-es`, which adds support for
ES7 features like `async`/`await` in the minification of embedded JavaScript.

We've also changed the `clean-css` dependency to `@ndcode/clean-css`, which
behaves exactly the same but avoids loading the `clean-css` dependency twice in
packages that depend on both `@ndcode/html-minifier` and `@ndcode/clean-css`.

Suppose this package is imported as
  `let html_minifier = require('@ndcode/html-minifier')`,
in addition to the usual `html_minifier.minify()` function, we've also exported
the internal HTML parser constructor, so that parsers can be instanstiated as
  `new html_minifier.HTMLParser(...)`,
with arguments as shown in the existing code. This is for our `jstize` package.

## GIT repository

The development version can be cloned, downloaded, or browsed with `gitweb` at:
https://git.ndcode.org/public/html-minifier.git

## License

All of our NPM packages are MIT licensed, please see LICENSE in the repository.

## Contributions

Feedback on NDCODE packages and/or code contributions are gratefully welcomed.

Contact: Nick Downing <nick@ndcode.org>
npm package: @ndcode/json_cache
Description: Load JSON files which can be changed while system is live
Latest version: 0.1.2

# Build Cache wrapper for JSON files

An NDCODE project.

## Overview

The `json_cache` package exports a single constructor
  `JSONCache(diag)`
which must be called with the `new` operator. The resulting cache object stores
the JavaScript instantiation of JSON files loaded and parsed from disk.

See the `build_cache` package for more information. The `JSONCache` object is
essentially a wrapper object which routes the request between the `build_cache`
package and the asynchronous `fs.readFile()` and `JSON.parse` APIs of Node.js,
to ensure that the file is retrieved from either RAM or disk as required.

## Calling API

Suppose one has a `JSONCache` instance named `jc`. It behaves somewhat like an
ES6 `Map` object, except that it only has the `jc.get()` function, because new
objects are added to the cache by attempting to `get` them.

The interface for the `JSONCache`-provided instance function `jc.get()` is:

`await jc.get(key)` &mdash; retrieves the object stored under `key`, where
`key` is the on-disk pathname to a JSON file. A JavaScript object is returned,
as in
  `JSON.parse(await util.promisify(fs.readFile)(key, {encoding: 'utf-8'}))`,
except that the pathname and the parsed result are cached for future reuse.

Before returning the cached copy, the existence and modification time of the
JSON file on disk is checked to make sure that the cache is up-to-date.
Otherwise, if the file doesn't exist an `ENOENT` exception is thrown, or if the
file exists it is loaded and parsed and the cache updated for next time.

## About diagnostics

The `diag` argument to the constructor is a `bool`, which if `true` causes
messages to be printed via `console.log()` for all activities except for the
common case of retrieval when the object is already up-to-date. A `diag` value
of `undefined` is treated as `false`, thus it can be omitted in the usual case.

## To be implemented

It is intended that we will shortly add a timer function (or possibly just a
function that the user should call periodically) to flush built templates from
the cache after a stale time. There is otherwise no way to delete an object
from the cache, except by first deleting it on disk, then trying to `get` it.

## GIT repository

The development version can be cloned, downloaded, or browsed with `gitweb` at:
https://git.ndcode.org/public/json_cache.git

## License

All of our NPM packages are MIT licensed, please see LICENSE in the repository.

## Contributions

The caching system is under active development (and is part of a larger project
that is also under development) and thus the API is tentative. Please go ahead
and incorporate the system into your project, or try out our example webserver
built on the system, subject to the caution that the API could change. Please
send us your experience and feedback, and let us know of improvements you make.

Contact: Nick Downing <nick@ndcode.org>
npm package: @ndcode/text_cache
Description: Load text files which can be changed while system is live
Latest version: 0.1.0

# Build Cache wrapper for text files

An NDCODE project.

## Overview

The `text_cache` package exports a single constructor
  `TextCache(diag)`
which must be called with the `new` operator. The resulting cache object stores
the `utf-8`-decoded text of text files loaded from disk.

See the `build_cache` package for more information. The `TextCache` object is
essentially a wrapper object which routes the request between the `build_cache`
package and the asynchronous `fs.readFile()` API of Node.js, to ensure that the
file is retrieved from either RAM or disk as required.

## Calling API

Suppose one has a `TextCache` instance named `tc`. It behaves somewhat like an
ES6 `Map` object, except that it only has the `tc.get()` function, because new
objects are added to the cache by attempting to `get` them.

The interface for the `TextCache`-provided instance function `tc.get()` is:

`await tc.get(key)` &mdash; retrieves the object stored under `key`, where
`key` is the on-disk pathname to a text file. A `String` is returned, as in
  `await util.promisify(fs.readFile)(key, {encoding: 'utf-8'})`,
except that the pathname and the decoded result are cached for future reuse.

Before returning the cached copy, the existence and modification time of the
text file on disk is checked to make sure that the cache is up-to-date.
Otherwise, if the file doesn't exist an `ENOENT` exception is thrown, or if the
file exists it is loaded and decoded and the cache updated for next time.

## About diagnostics

The `diag` argument to the constructor is a `bool`, which if `true` causes
messages to be printed via `console.log()` for all activities except for the
common case of retrieval when the object is already up-to-date. A `diag` value
of `undefined` is treated as `false`, thus it can be omitted in the usual case.

## To be implemented

It is intended that we will shortly add a timer function (or possibly just a
function that the user should call periodically) to flush built templates from
the cache after a stale time. There is otherwise no way to delete an object
from the cache, except by first deleting it on disk, then trying to `get` it.

## GIT repository

The development version can be cloned, downloaded, or browsed with `gitweb` at:
https://git.ndcode.org/public/text_cache.git

## License

All of our NPM packages are MIT licensed, please see LICENSE in the repository.

## Contributions

The caching system is under active development (and is part of a larger project
that is also under development) and thus the API is tentative. Please go ahead
and incorporate the system into your project, or try out our example webserver
built on the system, subject to the caution that the API could change. Please
send us your experience and feedback, and let us know of improvements you make.

Contact: Nick Downing <nick@ndcode.org>
npm package: @ndcode/zip_cache
Description: Load zipfiles which can be changed while system is live
Latest version: 0.1.0

# Build Cache wrapper for zipfiles

An NDCODE project.

## Overview

The `zip_cache` package exports a single constructor
  `ZipCache(diag)`
which must be called with the `new` operator. The resulting cache object stores
the decompressed contents of zipfiles loaded from disk.

See the `build_cache` and `yauzl` packages for more information. The `ZipCache`
object is essentially a wrapper object which routes the request between the
`build_cache` package and the streaming `yauzl` zipfile-reading API, to ensure
that the zipfile contents are retrieved from either RAM or disk as required.

## Calling API

Suppose one has a `ZipCache` instance named `zc`. It behaves somewhat like an
ES6 `Map` object, except that it only has the `zc.get()` function, because new
objects are added to the cache by attempting to `get` them.

The interface for the `ZipCache`-provided instance function `zc.get()` is:

`await zc.get(key)` &mdash; retrieves the object stored under `key`, where
`key` is the on-disk pathname to a zipfile. A dictionary mapping `String` to
`Buffer` objects is returned, where the `String` is the absolute pathname of a
file within the zipfile (always beginning with `/`), and the `Buffer` is the
binary contents of the file. This dictionary is then cached for future use.

Before returning the cached dictionary, the existence and modification time of
the zipfile on disk is checked to make sure that the cache is up-to-date.
Otherwise, if the file doesn't exist an `ENOENT` exception is thrown, or if the
file exists it is scanned and decompressed and the cache updated for next time.

## About diagnostics

The `diag` argument to the constructor is a `bool`, which if `true` causes
messages to be printed via `console.log()` for all activities except for the
common case of retrieval when the object is already up-to-date. A `diag` value
of `undefined` is treated as `false`, thus it can be omitted in the usual case.

## To be implemented

It is intended that we will shortly add a timer function (or possibly just a
function that the user should call periodically) to flush built templates from
the cache after a stale time. There is otherwise no way to delete an object
from the cache, except by first deleting it on disk, then trying to `get` it.

## GIT repository

The development version can be cloned, downloaded, or browsed with `gitweb` at:
https://git.ndcode.org/public/zip_cache.git

## License

All of our NPM packages are MIT licensed, please see LICENSE in the repository.

## Contributions

The caching system is under active development (and is part of a larger project
that is also under development) and thus the API is tentative. Please go ahead
and incorporate the system into your project, or try out our example webserver
built on the system, subject to the caution that the API could change. Please
send us your experience and feedback, and let us know of improvements you make.

Contact: Nick Downing <nick@ndcode.org>