# apg-lib

> (Deprecated: use apg-js instead.) Library of core parsing modules required by apg and apg-generated parsers.

Latest version **3.1.1** (published 2021-04-26) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install apg-lib
pnpm add apg-lib
yarn add apg-lib
bun add apg-lib
```

## 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 | 3.1.1 |
| Published | 2021-04-26 |
| First published | 2015-10-31 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 125.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Lowell D. Thomas |
| Maintainers | ldthomas |
| Keywords | apg, parser, generator, ABNF |

## Links

- npm: https://www.npmjs.com/package/apg-lib
- Repository: https://github.com/ldthomas/apg-js2-lib
- Homepage: https://github.com/ldthomas/apg-js2-lib#readme
- Issues: https://github.com/ldthomas/apg-js2-lib/issues
- npm.io page: https://npm.io/package/apg-lib

## Dependencies (1)

- [apg-conv-api](https://npm.io/package/apg-conv-api.md) 1.0.x

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 3.1.1 (latest) — 2021-04-26
- 3.2.0 — 2017-06-21
- 3.1.0 — 2017-04-16
- 3.0.0 — 2017-02-17
- 2.1.5 — 2016-05-23
- 2.1.4 — 2016-04-13
- 2.1.3 — 2016-03-29
- 2.1.2 — 2016-03-23
- 2.1.1 — 2016-03-08
- 2.1.0 — 2016-03-05
- 2.0.1 — 2015-11-14
- 2.0.0 — 2015-10-31

## README

## JavaScript APG Parsing Library

_**Deprecated:** Use [apg-js](https://www.npmjs.com/package/apg-js) instead. See [apg-js-examples](https://www.npmjs.com/package/apg-js-examples) for usage._

**Description:**  
The JavaScript APG Parsing Library contains the basic core support code needed to run both <a href="https://github.com/ldthomas/apg-js2">apg<a/>, the parser generator, and the parsers that it generates.

**Installation:**

github:

```
git clone https://github.com/ldthomas/apg-js2-lib.git /path/to/my-copy-of-apg-lib
mkdir my-project
cd my-project
npm init
npm install /path/to/my-copy-of-apg-lib --save
```

npm:

```
mkdir my-project
cd my-project
npm init
npm install apg-lib --save
```

In your application code you can now access the apg library with `require("apg-lib")`
(see <a href="https://github.com/ldthomas/apg-js2-examples">examples</a>)

**Web page use:**

```
git clone https://github.com/ldthomas/apg-js2-lib.git apg-dir
```

In the header of your web page now include the resources:

```
<link rel="stylesheet" href="./apg-dir/apglib.css">
<script src="./apg-dir/apglib.js" charset="utf-8"></script>
or
<link rel="stylesheet" href="./apg-dir/apglib-min.css">
<script src="./apg-dir/apglib-min.js" charset="utf-8"></script>
```

Note that some `apg-lib` functions return results as HTML strings. `apglib.css` is required to properly style the HTML elements.
In your web page JavaSript code you can now access the apg-lib modules through the `apglib` object.
For example, to create a parser

```
var my-parser = new apglib.parser();
```

See the [browser](https://github.com/ldthomas/apg-js2-examples/tree/master/simple/browser) example, for specifics.
See, also, this [CodePen](http://codepen.io/apg-exp/pen/ZWKGqQ).

**Examples:**  
See <a href="https://github.com/ldthomas/apg-js2-examples">apg-js2-examples</a> for examples of running JavaScript APG and the parsers it generates.

**Documentation:**  
The full documentation is in the code in [`docco`](https://jashkenas.github.io/docco/) format.
To generate the documentation, from the package directory:

```
npm install -g docco
./docco-gen
```

View `docs/index.html` in any web browser to get started.
Or view it on the [APG website](http://coasttocoastresearch.com/docjs2/apg-lib/index.html)

**Copyright:**  
_Copyright &copy; 2017 Lowell D. Thomas, all rights reserved_

**License:**  
Released under the BSD-3-Clause license.

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