Package Exports
- postal-async-m1
- postal-async-m1/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (postal-async-m1) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
postal-async-m1
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.
Install
$ npm install --save postal-async
Usage
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