Async NAPI based interface for libpostal; now with M1 support.
npm install postal-async-m1[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
Async NAPI based interface for [libpostal]
This package comes with support for Apple M1.
PR on main repo is in progress.
Until it is merged and released, this fork can be used.
``sh`
$ npm install --save postal-async
`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"
)
);
});
``
MIT © Damian Krzeminski
[npm-image]: https://img.shields.io/npm/v/postal-async.svg
[npm-url]: https://npmjs.org/package/postal-async
[travis-url]: https://travis-ci.com/pirxpilot/postal-async
[travis-image]: https://img.shields.io/travis/com/pirxpilot/postal-async.svg
[libpostal]: https://github.com/openvenues/libpostal