# wit-node

> wit-node: Easy interface for wit.ai natural language parsing

Latest version **0.0.5** (published 2014-08-26) · 0 weekly downloads

## Install

```sh
npm install wit-node
pnpm add wit-node
yarn add wit-node
bun add wit-node
```

## 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.0.5 |
| Published | 2014-08-26 |
| First published | 2013-10-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 0.8.x |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Jeremy Jackson |
| Maintainers | jejackson |
| Keywords | wit.ai, wit, natural language parsing |

## Links

- npm: https://www.npmjs.com/package/wit-node
- Repository: https://github.com/modeset/wit-node
- Issues: https://github.com/modeset/wit-node/issues
- npm.io page: https://npm.io/package/wit-node

## Dependencies (1)

- [q](https://npm.io/package/q.md) 0.9.7

## Recent versions

- 0.0.5 (latest) — 2014-08-26
- 0.0.4 — 2013-11-21
- 0.0.3 — 2013-10-19
- 0.0.2 — 2013-10-18
- 0.0.1 — 2013-10-18

## README

wit-node
========

Easy interface for interacting with the [Wit.ai](http://wit.ai) natural language parsing API.

This project will expand as the Wit.ai API expands, but as it stands there's a single endpoint. You can hit this
endpoint easily with `Wit.message([your message])`, which uses Wit.ai to convert that phrase or sentence into an object
with an intent and entities if any were specified.

You will need to create a Wit.ai account and begin training it.

## Installation

```shell
npm install wit-node@">=0.0.2"
```

You'll need to set an environment variable named `WIT_TOKEN` or specify your token with `Wit.token = [your token]`.

```shell
export WIT_TOKEN=[your token]
```

Alternatively, you can pass the token to `Wit.message()` as the second parameter.


## Usage

Wit uses [Q](https://github.com/kriskowal/q) for promises, so the interface is nice and clean and reliable.

```javascript
var promise = Wit.message('Hi')
promise.then(function(result) {
  result.intent // will be Hello with the default Wit instance.
  result.confidence // will be relatively low initially.
})
```

### Result properties/methods

<dl>

<dt> raw </dt><dd>
Raw response object (parsed JSON)
</dd>

<dt> text </dt><dd>
The original message sent.
</dd>

<dt> intent </dt><dd>
The intent, as determined by Wit.
</dd>

<dt> confidence </dt><dd>
The confidence level that Wit determined.
</dd>

<dt> entities </dt><dd>
Object of entities, which contain the value, and the start/end position within msgBody.
</dd>

</dl>

### Entity properties/methods

<dl>

<dt> value </dt><dd>
The value as determined by Wit (might not be the same as body).
</dd>

<dt> start </dt><dd>
The start position index from msgBody.
</dd>

<dt> end </dt><dd>
The end position index from msgBody.
</dd>

<dt> body </dt><dd>
The actual value as specified in msgBody.
</dd>

</dl>


## License

Licensed under the [MIT License](http://creativecommons.org/licenses/MIT/)

Copyright 2012 [Mode Set](https://github.com/modeset)


## Make Code Not War
![crest](https://secure.gravatar.com/avatar/aa8ea677b07f626479fd280049b0e19f?s=75)

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