--- spec: openflange.org/pipe/v0.1 id: slugify version: 0.1.0 title: Slugify description: Turns each string into a lower-case, hyphen-separated URL slug. license: Apache-2.0 keywords: [npm, node, javascript, text, slug, example] maturity: experimental scope: record cardinality: one-to-one deterministic: true inputs: text: description: Strings, one JSON string per NDJSON line. schema: format: json-schema definition: {type: string} outputs: slug: description: The slug of each string, in input order. schema: format: json-schema definition: {type: string} implementation: type: script language: node path: slugify.js permissions: subprocess: true --- # Slugify Implements the [OpenFlange](https://openflange.org/) specification. An npm package that **is** a pipe: `package.json` points at this manifest with `"openflange": {"manifest": "OPENFLANGE.md"}`, and `slugify.js` is an ordinary Node.js stdin → stdout filter with no dependencies. See [README.md](README.md) for input → command → output. Accents are removed (`Crème` → `creme`), letters and digits of any script are kept, every other run of characters becomes one hyphen. A string with no letters or digits gives the empty string. A non-string item fails the run (`E_RUNTIME`). Permissions: `subprocess` (it starts `node`). No network, no files.