npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tiangong-lca/tidas-sdk

v0.2.0

Published

TypeScript SDK for ILCD/Tidas data management

Readme

TIDAS TypeScript SDK

TypeScript SDK for the TIDAS (TianGong Life Cycle Assessment data format) contracts, runtime validation, XML conversion, and package-level parity tools.

Published package: @tiangong-lca/tidas-sdk. Read the installed package metadata or npm registry for the current version.

Node.js 24 or newer and the root-pinned [email protected] are required for development.

Installation

pnpm add @tiangong-lca/tidas-sdk

Public entry points

| Entry point | Purpose | | --- | --- | | @tiangong-lca/tidas-sdk | Combined public API | | @tiangong-lca/tidas-sdk/core | Entity classes and current factory functions | | @tiangong-lca/tidas-sdk/types | Generated TIDAS TypeScript types | | @tiangong-lca/tidas-sdk/schemas | Generated Zod schemas and validation helpers | | @tiangong-lca/tidas-sdk/contracts | TIDAS context and methodology contracts | | @tiangong-lca/tidas-sdk/parity | Package-directory JSON Schema validation | | @tiangong-lca/tidas-sdk/xml | XML parsing and serialization | | @tiangong-lca/tidas-sdk/tools | Directory conversion and runtime assets | | @tiangong-lca/tidas-sdk/utils | General SDK utilities |

Every entry point is exercised through CJS, ESM, and TypeScript declaration consumer tests before release.

Current factory API

The maintained entity factories are:

import {
  createContact,
  createFlow,
  createFlowProperty,
  createLCIAMethod,
  createLifeCycleModel,
  createProcess,
  createSource,
  createUnitGroup,
} from '@tiangong-lca/tidas-sdk/core';

Each entity also has FromJSON and plural Batch variants. Multilingual fields use the standard TIDAS item or item-array representation; the SDK does not expose setText/getText methods.

import { createContact } from '@tiangong-lca/tidas-sdk/core';

const contact = createContact();
const information =
  contact.contactDataSet.contactInformation.dataSetInformation;

information['common:name'] = [
  { '@xml:lang': 'en', '#text': 'Example data steward' },
];

const result = contact.validate();
if (!result.success) {
  console.error(result.error.issues);
}

A complete, valid contact draft is maintained at examples/01-basic-usage/contact-draft.ts.

Schema validation

import {
  ContactSchema,
  parseWithZod,
  validateWithZod,
} from '@tiangong-lca/tidas-sdk/schemas';

const result = validateWithZod(value, ContactSchema);
const parsed = parseWithZod(jsonText, ContactSchema);

Generated schemas come directly from the asset-lock-selected Draft-07 JSON Schema documents. Named domain overlays preserve CAS checks, multilingual validation codes, common:other, required multilingual values, Flow name conditions, and review conditions. Generation fails when it encounters a validation keyword or overlay location that is not explicitly supported.

For stable programmatic error handling, entity callers should prefer validateEnhanced() and consume normalized validationIssues rather than parsing Zod message text.

Package parity validation

import { validatePackageDir } from '@tiangong-lca/tidas-sdk/parity';

const report = validatePackageDir('/path/to/tidas-package');
if (!report.ok) {
  console.error(report.issues);
}

XML and directory conversion

import { datasetFromXml, datasetToXml } from '@tiangong-lca/tidas-sdk/xml';
import { convertDirectory } from '@tiangong-lca/tidas-sdk/tools';

const dataset = datasetFromXml(xmlPayload);
const xml = datasetToXml(dataset);

await convertDirectory('./input', './output', { toXml: true });
await convertDirectory('./eilcd-data', './tidas-output', { toXml: false });

Database export, ZIP publishing, and S3 workflows remain owned by tidas-tools.

Development

# Run from the repository root with the exact pnpm version in package.json.
pnpm install --frozen-lockfile
pnpm --filter @tiangong-lca/tidas-sdk lint
pnpm --filter @tiangong-lca/tidas-sdk typecheck
pnpm --filter @tiangong-lca/tidas-sdk test
pnpm --filter @tiangong-lca/tidas-sdk check:examples
pnpm --filter @tiangong-lca/tidas-sdk build

The root pnpm-workspace.yaml and pnpm-lock.yaml are the only workspace and dependency-lock sources. The package uses a single [email protected] compiler track. Oxlint performs type-aware linting, Node 24 runs tests through tsx, and the published tarball does not carry compiler, generator, lint, or test tooling into consumers.

Useful commands:

pnpm --filter @tiangong-lca/tidas-sdk generate-types
pnpm --filter @tiangong-lca/tidas-sdk generate-schemas
pnpm --filter @tiangong-lca/tidas-sdk verify:schema-generation-parity
pnpm --filter @tiangong-lca/tidas-sdk test:coverage
pnpm --filter @tiangong-lca/tidas-sdk format:check

For generator parity, build the baseline before editing the generator. The default baseline is dist/schemas; TIDAS_ZOD_BASELINE_DIR and TIDAS_ZOD_CANDIDATE_DIR can select explicit artifacts. Automatic candidate output is always cleaned.

The maintained examples are executable contracts:

  • examples/01-basic-usage/contact-draft.ts
  • examples/02-xml-roundtrip/xml-roundtrip.ts
  • examples/test-imports.ts

Run all of them with pnpm --filter tidas-sdk-examples check.

Release

The normal release path is documented in RELEASE.md. Before a release PR, run the repository wrapper from the repository root:

./scripts/ci/verify-typescript-package.sh

After merge, the exact merged commit is tagged as typescript-vX.Y.Z and the repository-owned Trusted Publishing workflow publishes it.

Repository documentation

License

MIT — see LICENSE.