Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pirxpilot/postal-async
Async NAPI based interface for libpostal
https://github.com/pirxpilot/postal-async
Last synced: 13 days ago
JSON representation
Async NAPI based interface for libpostal
- Host: GitHub
- URL: https://github.com/pirxpilot/postal-async
- Owner: pirxpilot
- Created: 2019-07-26T05:30:27.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-06T08:14:44.000Z (9 months ago)
- Last Synced: 2024-11-25T00:06:00.109Z (19 days ago)
- Language: C++
- Homepage:
- Size: 31.3 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
[![NPM version][npm-image]][npm-url]
[![Build Status][build-image]][build-url]# postal-async
Async NAPI based interface for [libpostal]
## Install
```sh
$ npm install --save postal-async
```## Usage
```js
const { parse, expand } = require('postal-async');expand('781 Franklin Ave Crown Hts Brooklyn NY', function(err, expansions) {
// expansion is an array of expanded addresses
assert(expansions.includes('781 franklin avenue crown heights brooklyn new york'));
});parse('781 Franklin Ave Crown Hts Brooklyn NY', function(err, parsed) {
// parsed is an object with house_number, street etc.
assert(parsed.find(({ value, label }) => label === 'house_number' && value === '781'));
});```
## License
MIT © [Damian Krzeminski](https://pirxpilot.me)
[npm-image]: https://img.shields.io/npm/v/postal-async
[npm-url]: https://npmjs.org/package/postal-async[build-url]: https://github.com/pirxpilot/postal-async/actions/workflows/check.yaml
[build-image]: https://img.shields.io/github/actions/workflow/status/pirxpilot/postal-async/check.yaml?branch=main[libpostal]: https://github.com/openvenues/libpostal