# @ifc-lite/encoding

> IFC string encoding/decoding and property value parsing for IFC-Lite

Latest version **2.2.0** (published 2026-09-04) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install @ifc-lite/encoding
pnpm add @ifc-lite/encoding
yarn add @ifc-lite/encoding
bun add @ifc-lite/encoding
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2026-09-04 |
| First published | 2026-02-12 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 91.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 375 |
| Author | Louis True |
| Maintainers | louistrue |
| Keywords | ifc, bim, encoding, step, aec |

## Links

- npm: https://www.npmjs.com/package/@ifc-lite/encoding
- Repository: https://github.com/LTplus-AG/ifc-lite
- Homepage: https://ifclite.dev/docs/
- Issues: https://github.com/LTplus-AG/ifc-lite/issues
- npm.io page: https://npm.io/package/@ifc-lite/encoding

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 2.2.0 (latest) — 2026-09-04
- 2.1.0 — 2026-08-24
- 2.0.0 — 2026-08-12
- 1.16.0 — 2026-08-10
- 1.15.1 — 2026-08-09
- 1.15.0 — 2026-07-31
- 1.14.11 — 2026-07-17
- 1.14.10 — 2026-07-10
- 1.14.9 — 2026-07-10
- 1.14.8 — 2026-07-02
- 1.14.7 — 2026-06-10
- 1.14.6 — 2026-04-01
- 1.14.5 — 2026-03-29
- 1.14.4 — 2026-03-11
- 1.14.3 — 2026-03-08
- … 14 more at https://npm.io/package/@ifc-lite/encoding/versions

## README

# @ifc-lite/encoding

IFC string encoding and decoding, GlobalId (GUID) utilities, and property value parsing. Small, dependency-free helpers for the text-level details of IFC STEP files: the `\X2\...\X0\` escape sequences used for non-ASCII characters, the 22-character base64-like IFC GUID format, and typed STEP property values like `IFCBOOLEAN(.T.)`.

## Install

```bash
npm install @ifc-lite/encoding
```

## Usage

```ts
import {
  decodeIfcString,
  encodeIfcString,
  generateIfcGuid,
  ifcGuidToUuid,
  parsePropertyValue,
} from '@ifc-lite/encoding';

decodeIfcString('Gew\\X2\\00E4\\X0\\chshaus'); // 'Gewächshaus' (real umlaut)
encodeIfcString('Tür');                   // 'T\\X\\FCr'

const guid = generateIfcGuid();  // 22-char IFC GlobalId
const uuid = ifcGuidToUuid(guid); // standard UUID form

parsePropertyValue(['IFCBOOLEAN', '.T.']); // { displayValue: 'True', ifcType: ... }
```

## Exports

- `decodeIfcString` / `encodeIfcString`: STEP `\X2\`, `\X\`, `\S\` escape handling
- `generateIfcGuid`, `generateUuid`: new identifiers
- `uuidToIfcGuid`, `ifcGuidToUuid`: convert between UUIDs and 22-char IFC GUIDs
- `isValidIfcGuid`, `isValidUuid`: validation
- `parsePropertyValue`: turn a parsed STEP property value (typed arrays, `.T.`/`.F.`, enums) into a display string plus optional IFC type name. It does **not** decode `\X2\`-style escapes: every ifc-lite parse path already decodes exactly once, at the parse boundary, and decoding a second time would collapse an authored `\\` a second time. Pass a still-encoded literal through `decodeIfcString` first.

## Links

- Docs: https://ifclite.dev/docs/
- Source: https://github.com/LTplus-AG/ifc-lite

## License

MPL-2.0

---
_Source: https://npm.io/package/@ifc-lite/encoding · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
