@mailwoman/libpostal 4.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/out/cli.d.ts +16 -0
- package/out/cli.d.ts.map +1 -0
- package/out/cli.js +63 -0
- package/out/cli.js.map +1 -0
- package/out/index.d.ts +44 -0
- package/out/index.d.ts.map +1 -0
- package/out/index.js +82 -0
- package/out/index.js.map +1 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @mailwoman/libpostal
|
|
2
|
+
|
|
3
|
+
A **libpostal-compatible** parse/expand HTTP API over [Mailwoman](https://mailwoman.sister.software)'s
|
|
4
|
+
neural address parser. The lowest-dependency drop-in — `/parse` needs no gazetteer, just the model.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npx @mailwoman/libpostal serve --port 8081
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
curl -s "http://localhost:8081/parse?query=1600 Pennsylvania Ave NW, Washington DC 20500"
|
|
12
|
+
# [{"label":"house_number","value":"1600"},{"label":"road","value":"Pennsylvania Ave NW"},
|
|
13
|
+
# {"label":"city","value":"Washington"},{"label":"state","value":"DC"},{"label":"postcode","value":"20500"}]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Endpoints
|
|
17
|
+
|
|
18
|
+
| Endpoint | libpostal contract |
|
|
19
|
+
| --------- | --------------------------------------------------------- |
|
|
20
|
+
| `/parse` | `parse_address` — ordered `[{label, value}]` components |
|
|
21
|
+
| `/expand` | `expand_address` — normalized forms (see the honest note) |
|
|
22
|
+
|
|
23
|
+
`/parse` maps Mailwoman's `ComponentTag` classifications to libpostal's labels (`street`→`road`,
|
|
24
|
+
`locality`→`city`, `region`→`state`, …) via `COMPONENT_TO_LIBPOSTAL`.
|
|
25
|
+
|
|
26
|
+
**Honest note on `/expand`:** Mailwoman's normalization is deterministic, so `/expand` returns the
|
|
27
|
+
original plus its normalized + abbreviation-expanded forms — not libpostal's probabilistic multi-variant
|
|
28
|
+
expansion. One canonical alternative, not a hypothesis set.
|
|
29
|
+
|
|
30
|
+
## Library use
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import express from "express"
|
|
34
|
+
import { createLibpostalRouter, type LibpostalEngine } from "@mailwoman/libpostal"
|
|
35
|
+
|
|
36
|
+
const engine: LibpostalEngine = {
|
|
37
|
+
async parse(query) {
|
|
38
|
+
/* return [{ classification, value }] from your parser */
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
express().use(createLibpostalRouter(engine)).listen(8081)
|
|
42
|
+
```
|
package/out/cli.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @copyright Sister Software
|
|
4
|
+
* @license AGPL-3.0
|
|
5
|
+
* @author Teffen Ellis, et al.
|
|
6
|
+
*
|
|
7
|
+
* `mailwoman-libpostal` — boot a libpostal-compatible parse/expand endpoint via the `serve`
|
|
8
|
+
* command. Usage + examples live in the package README.
|
|
9
|
+
*
|
|
10
|
+
* Wires the real engine: `/parse` over Mailwoman's `createAddressParser` (the neural BIO tagger),
|
|
11
|
+
* `/expand` over `@mailwoman/normalize`. `/expand` is honest-minimal: it returns the original
|
|
12
|
+
* plus the deterministic normalized + abbreviation-expanded forms, not libpostal's probabilistic
|
|
13
|
+
* variants.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=cli.d.ts.map
|
package/out/cli.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG"}
|
package/out/cli.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @copyright Sister Software
|
|
4
|
+
* @license AGPL-3.0
|
|
5
|
+
* @author Teffen Ellis, et al.
|
|
6
|
+
*
|
|
7
|
+
* `mailwoman-libpostal` — boot a libpostal-compatible parse/expand endpoint via the `serve`
|
|
8
|
+
* command. Usage + examples live in the package README.
|
|
9
|
+
*
|
|
10
|
+
* Wires the real engine: `/parse` over Mailwoman's `createAddressParser` (the neural BIO tagger),
|
|
11
|
+
* `/expand` over `@mailwoman/normalize`. `/expand` is honest-minimal: it returns the original
|
|
12
|
+
* plus the deterministic normalized + abbreviation-expanded forms, not libpostal's probabilistic
|
|
13
|
+
* variants.
|
|
14
|
+
*/
|
|
15
|
+
import { expandAbbreviations, normalize } from "@mailwoman/normalize";
|
|
16
|
+
import express from "express";
|
|
17
|
+
import { createAddressParser } from "mailwoman";
|
|
18
|
+
import { parseArgs } from "node:util";
|
|
19
|
+
import { createLibpostalRouter } from "./index.js";
|
|
20
|
+
function serve() {
|
|
21
|
+
const { values } = parseArgs({
|
|
22
|
+
options: {
|
|
23
|
+
port: { type: "string", default: "8081" },
|
|
24
|
+
host: { type: "string", default: "0.0.0.0" },
|
|
25
|
+
},
|
|
26
|
+
allowPositionals: true,
|
|
27
|
+
});
|
|
28
|
+
const port = Number(values.port) || 8081;
|
|
29
|
+
const host = values.host ?? "0.0.0.0";
|
|
30
|
+
const parser = createAddressParser();
|
|
31
|
+
const engine = {
|
|
32
|
+
async parse(query) {
|
|
33
|
+
const result = await parser.parse(query, { verbose: true });
|
|
34
|
+
const solution = result.solutions[0];
|
|
35
|
+
if (!solution)
|
|
36
|
+
return [];
|
|
37
|
+
const json = solution.toJSON();
|
|
38
|
+
return (json.matches ?? []).map((m) => ({ classification: m.classification, value: m.value }));
|
|
39
|
+
},
|
|
40
|
+
async expand(address) {
|
|
41
|
+
const normalized = normalize(address).normalized;
|
|
42
|
+
const expanded = expandAbbreviations(normalized).text;
|
|
43
|
+
// Deterministic forms only; dedup while preserving order.
|
|
44
|
+
return [...new Set([address, normalized, expanded])];
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
express()
|
|
48
|
+
.use(createLibpostalRouter(engine))
|
|
49
|
+
.listen(port, host, () => {
|
|
50
|
+
console.error(`[@mailwoman/libpostal] listening on http://${host}:${port}`);
|
|
51
|
+
console.error(` endpoints: POST/GET /parse POST/GET /expand`);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const command = process.argv[2];
|
|
55
|
+
switch (command) {
|
|
56
|
+
case "serve":
|
|
57
|
+
serve();
|
|
58
|
+
break;
|
|
59
|
+
default:
|
|
60
|
+
console.error("Usage: mailwoman-libpostal serve [--port 8081] [--host 0.0.0.0]");
|
|
61
|
+
process.exit(command ? 1 : 0);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=cli.js.map
|
package/out/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,qBAAqB,EAAyC,MAAM,YAAY,CAAA;AAEzF,SAAS,KAAK;IACb,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QAC5B,OAAO,EAAE;YACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE;YACzC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE;SAC5C;QACD,gBAAgB,EAAE,IAAI;KACtB,CAAC,CAAA;IAEF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAA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IAChE,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AAE/B,QAAQ,OAAO,EAAE,CAAC;IACjB,KAAK,OAAO;QACX,KAAK,EAAE,CAAA;QACP,MAAK;IACN;QACC,OAAO,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAA;QAChF,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC/B,CAAC"}
|
package/out/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `@mailwoman/libpostal` — a libpostal-compatible parse/expand HTTP API over Mailwoman's neural
|
|
7
|
+
* address parser. The lowest-dependency drop-in: `/parse` is a serializer over the BIO tagger's
|
|
8
|
+
* labeled spans, no gazetteer or resolver needed.
|
|
9
|
+
*
|
|
10
|
+
* Engine-agnostic, like the nominatim/photon packages: {@link createLibpostalRouter} takes a
|
|
11
|
+
* {@link LibpostalEngine}; the CLI wires the real parser. The classification → libpostal-label
|
|
12
|
+
* mapping lives here (it is libpostal-specific knowledge), so the engine yields raw Mailwoman
|
|
13
|
+
* matches.
|
|
14
|
+
*/
|
|
15
|
+
import { Router } from "express";
|
|
16
|
+
/** A libpostal `parse_address` component: a label + the text it covers, in order. */
|
|
17
|
+
export interface LibpostalComponent {
|
|
18
|
+
label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}
|
|
21
|
+
/** A raw Mailwoman match the engine yields (our `ComponentTag` classification + the covered text). */
|
|
22
|
+
export interface ParseMatch {
|
|
23
|
+
classification: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Mailwoman `ComponentTag` → libpostal label. libpostal's label set is OSM-derived; ours is close
|
|
28
|
+
* but not identical, so map the overlap and pass unmapped classifications through unchanged.
|
|
29
|
+
*/
|
|
30
|
+
export declare const COMPONENT_TO_LIBPOSTAL: Record<string, string>;
|
|
31
|
+
/** Map raw Mailwoman matches to libpostal's ordered `[{label, value}]` shape. */
|
|
32
|
+
export declare function toLibpostalComponents(matches: ParseMatch[]): LibpostalComponent[];
|
|
33
|
+
/**
|
|
34
|
+
* The parsing engine the router delegates to. `parse` is required; `expand` is optional (a missing
|
|
35
|
+
* one answers `501`). The CLI wires `parse` to Mailwoman's `createAddressParser` and `expand` to
|
|
36
|
+
* `@mailwoman/normalize`.
|
|
37
|
+
*/
|
|
38
|
+
export interface LibpostalEngine {
|
|
39
|
+
parse(query: string): Promise<ParseMatch[]>;
|
|
40
|
+
expand?(address: string): Promise<string[]>;
|
|
41
|
+
}
|
|
42
|
+
/** Build the libpostal-compatible router around an injected {@link LibpostalEngine}. */
|
|
43
|
+
export declare function createLibpostalRouter(engine: LibpostalEngine): Router;
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAuB,MAAM,EAAE,MAAM,SAAS,CAAA;AAErD,qFAAqF;AACrF,MAAM,WAAW,kBAAkB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACb;AAED,sGAAsG;AACtG,MAAM,WAAW,UAAU;IAC1B,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAkBzD,CAAA;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,kBAAkB,EAAE,CAEjF;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC/B,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IAC3C,MAAM,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;CAC3C;AAED,wFAAwF;AACxF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CA4CrE"}
|
package/out/index.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `@mailwoman/libpostal` — a libpostal-compatible parse/expand HTTP API over Mailwoman's neural
|
|
7
|
+
* address parser. The lowest-dependency drop-in: `/parse` is a serializer over the BIO tagger's
|
|
8
|
+
* labeled spans, no gazetteer or resolver needed.
|
|
9
|
+
*
|
|
10
|
+
* Engine-agnostic, like the nominatim/photon packages: {@link createLibpostalRouter} takes a
|
|
11
|
+
* {@link LibpostalEngine}; the CLI wires the real parser. The classification → libpostal-label
|
|
12
|
+
* mapping lives here (it is libpostal-specific knowledge), so the engine yields raw Mailwoman
|
|
13
|
+
* matches.
|
|
14
|
+
*/
|
|
15
|
+
import { Router } from "express";
|
|
16
|
+
/**
|
|
17
|
+
* Mailwoman `ComponentTag` → libpostal label. libpostal's label set is OSM-derived; ours is close
|
|
18
|
+
* but not identical, so map the overlap and pass unmapped classifications through unchanged.
|
|
19
|
+
*/
|
|
20
|
+
export const COMPONENT_TO_LIBPOSTAL = {
|
|
21
|
+
house_number: "house_number",
|
|
22
|
+
street: "road",
|
|
23
|
+
venue: "house",
|
|
24
|
+
house: "house",
|
|
25
|
+
unit: "unit",
|
|
26
|
+
level: "level",
|
|
27
|
+
po_box: "po_box",
|
|
28
|
+
postcode: "postcode",
|
|
29
|
+
locality: "city",
|
|
30
|
+
dependent_locality: "suburb",
|
|
31
|
+
neighbourhood: "suburb",
|
|
32
|
+
borough: "city_district",
|
|
33
|
+
region: "state",
|
|
34
|
+
macroregion: "state_district",
|
|
35
|
+
country: "country",
|
|
36
|
+
country_region: "country_region",
|
|
37
|
+
world_region: "world_region",
|
|
38
|
+
};
|
|
39
|
+
/** Map raw Mailwoman matches to libpostal's ordered `[{label, value}]` shape. */
|
|
40
|
+
export function toLibpostalComponents(matches) {
|
|
41
|
+
return matches.map((m) => ({ label: COMPONENT_TO_LIBPOSTAL[m.classification] ?? m.classification, value: m.value }));
|
|
42
|
+
}
|
|
43
|
+
/** Build the libpostal-compatible router around an injected {@link LibpostalEngine}. */
|
|
44
|
+
export function createLibpostalRouter(engine) {
|
|
45
|
+
const router = Router();
|
|
46
|
+
const parse = async (req, res) => {
|
|
47
|
+
const query = (req.body?.query ?? req.query?.query ?? req.body?.address ?? req.query?.address)?.trim();
|
|
48
|
+
if (!query) {
|
|
49
|
+
res.status(400).json({ error: "query is required" });
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
res.json(toLibpostalComponents(await engine.parse(query)));
|
|
53
|
+
};
|
|
54
|
+
const expand = async (req, res) => {
|
|
55
|
+
if (!engine.expand) {
|
|
56
|
+
res.status(501).json({ error: "expand not implemented" });
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const address = (req.body?.address ?? req.query?.address)?.trim();
|
|
60
|
+
if (!address) {
|
|
61
|
+
res.status(400).json({ error: "address is required" });
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
res.json({ expansions: await engine.expand(address) });
|
|
65
|
+
};
|
|
66
|
+
// Safety net: a malformed body or an engine fault returns a clean JSON error, never a crash.
|
|
67
|
+
const safe = (fn) => async (req, res, next) => {
|
|
68
|
+
try {
|
|
69
|
+
await fn(req, res, next);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
if (!res.headersSent)
|
|
73
|
+
res.status(500).json({ error: "internal error" });
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
router.post("/parse", safe(parse));
|
|
77
|
+
router.get("/parse", safe(parse));
|
|
78
|
+
router.post("/expand", safe(expand));
|
|
79
|
+
router.get("/expand", safe(expand));
|
|
80
|
+
return router;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
package/out/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAuB,MAAM,EAAE,MAAM,SAAS,CAAA;AAcrD;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA2B;IAC7D,YAAY,EAAE,cAAc;IAC5B,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,MAAM;IAChB,kBAAkB,EAAE,QAAQ;IAC5B,aAAa,EAAE,QAAQ;IACvB,OAAO,EAAE,eAAe;IACxB,MAAM,EAAE,OAAO;IACf,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;IAChC,YAAY,EAAE,cAAc;CAC5B,CAAA;AAED,iFAAiF;AACjF,MAAM,UAAU,qBAAqB,CAAC,OAAqB;IAC1D,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;AACrH,CAAC;AAYD,wFAAwF;AACxF,MAAM,UAAU,qBAAqB,CAAC,MAAuB;IAC5D,MA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AC,CAAA;IAED,6FAA6F;IAC7F,MAAM,IAAI,GACT,CAAC,EAAkB,EAAkB,EAAE,CACvC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACxB,IAAI,CAAC;YACJ,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;QACzB,CAAC;QAAC,MAAM,CAAC;YACR,IAAI,CAAC,GAAG,CAAC,WAAW;gBAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,CAAA;QACxE,CAAC;IACF,CAAC,CAAA;IAEF,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAClC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IACjC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IACpC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IAEnC,OAAO,MAAM,CAAA;AACd,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mailwoman/libpostal",
|
|
3
|
+
"version": "4.15.1",
|
|
4
|
+
"description": "libpostal drop-in — a libpostal-compatible parse/expand HTTP API over Mailwoman's neural address parser. The lowest-dependency drop-in: parse needs no gazetteer. Run it with `npx @mailwoman/libpostal serve`.",
|
|
5
|
+
"license": "AGPL-3.0-only",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/sister-software/mailwoman.git",
|
|
9
|
+
"directory": "libpostal"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"exports": {
|
|
13
|
+
"./package.json": "./package.json",
|
|
14
|
+
".": "./out/index.js"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@mailwoman/normalize": "4.15.0",
|
|
18
|
+
"express": "^5.2.1",
|
|
19
|
+
"mailwoman": "4.15.0"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"out/**/*.js",
|
|
23
|
+
"out/**/*.js.map",
|
|
24
|
+
"out/**/*.d.ts",
|
|
25
|
+
"out/**/*.d.ts.map",
|
|
26
|
+
"README.md"
|
|
27
|
+
],
|
|
28
|
+
"bin": "./out/cli.js",
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
}
|
|
32
|
+
}
|