# apiary-blueprint-parser

> Apiary blueprint parser

Latest version **0.5.3** (published 2014-01-22) · 0 weekly downloads

## Install

```sh
npm install apiary-blueprint-parser
pnpm add apiary-blueprint-parser
yarn add apiary-blueprint-parser
bun add apiary-blueprint-parser
```

Provides the command `blueprint-parser`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.3 |
| Published | 2014-01-22 |
| First published | 2012-11-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.6.18 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Apiary Ltd. |
| Maintainers | apiary, dmajda, zdne |

## Links

- npm: https://www.npmjs.com/package/apiary-blueprint-parser
- Homepage: https://github.com/apiaryio/blueprint-parser
- npm.io page: https://npm.io/package/apiary-blueprint-parser

## Dependencies (1)

- [commander](https://npm.io/package/commander.md) 2.0.0

## Recent versions

- 0.5.3 (latest) — 2014-01-22
- 0.4.4 — 2013-03-25
- 0.4.3 — 2013-03-05
- 0.4.2 — 2013-03-01
- 0.4.1 — 2013-01-30
- 0.4.0 — 2013-01-10
- 0.3.0 — 2012-11-28
- 0.2.0 — 2012-11-26
- 0.1.1 — 2012-11-14
- 0.1.0 — 2012-11-12

## README

Apiary Blueprint Parser
=======================

A JavaScript parser of [Apiary API blueprints](http://apiary.io/blueprint).

Deprecation warning
-------
The Apiary Blueprint Parser is currently **frozen**. There is no future development planned. 

Please check the new [**API Blueprint**](http://apiblueprint.org) which **supersedes** the **Apiary Blueprint** and is completely open-sourced including its parser, tools and bindings.  

Installation
------------

### Node.js

    $ npm install apiary-blueprint-parser

Do not install the parser globally (using the `-g` option), otherwise you won’t be able to use the API.

### Browser

Download the [latest browser version of the parser](https://apiary-public.s3.amazonaws.com/blueprint-parser/apiary-blueprint-parser-0.5.3.js).

Usage
-----

In Node.js, require the module:

```javascript
var ApiaryBlueprintParser = require("apiary-blueprint-parser");
```

In browser, include the browser version of the parser in your web page or
application using the `<script>` tag. The parser will be available in the
`ApiaryBlueprintParser` global object.

To parse an API blueprint, just call the `parse` method and pass the blueprint
as a parameter. The method will return an object representing the parsed
blueprint or throw an exception if the input is invalid:

```javascript
var blueprint = ApiaryBlueprintParser.parse([
  "Root resource",
  "GET /",
  "< 200"
].join("\n"));

var resource = blueprint.sections[0].resources[0];
console.log(resource.description)     // prints "Root resource"
console.log(resource.method)          // prints "GET"
console.log(resource.url)             // prints "/"
console.log(resource.response.status) // prints "200"
```

See the `src/ast.coffee` file to get an idea about returned objects and their
capabilities.

The exception thrown in case of error will contain `offset`, `line`, `column`,
`expected`, `found` and `message` properties with more details about the error.

Compatibility
-------------

The parser should run well in the following environments:

  * Node.js 0.6.18+
  * IE 9+
  * Firefox
  * Chrome
  * Safari
  * Opera

The parser should also work in IE 8, but this is not fully tested because the
test suite runs correctly only in IE 9+.

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