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.1.33

Published

TypeScript SDK for ILCD/Tidas data management

Readme

TIDAS TypeScript SDK

TypeScript SDK for TIDAS (TianGong Life Cycle Assessment data format) providing type-safe data manipulation, validation, and comprehensive schema support.

🚀 Status

Version: 0.1.20 (Production Ready) Published: @tiangong-lca/tidas-sdk

✨ Features

  • Type-Safe Operations: Full TypeScript support with generated types
  • Runtime Validation: Zod schema validation for all TIDAS data types
  • Complete Schema Coverage: Support for all 18 TIDAS data types
  • Property Access: Convenient API for accessing nested properties
  • Object Utilities: Factory functions and manipulation utilities
  • JSON Conversion: Seamless serialization/deserialization
  • tidas-tools Parity APIs: Package-level validation compatibility
  • XML Conversion: xmltodict-backed XML <-> JS object helpers
  • Directory Tools: Batch .json <-> .xml conversion plus runtime asset copying

📦 Installation

npm install @tiangong-lca/tidas-sdk

Node.js 24+ is required.

🔧 Quick Start

Basic Usage

import { createTidasContact, TidasContact } from '@tiangong-lca/tidas-sdk';

// Create a contact using factory function
const contact = createTidasContact({
  name: 'Example Organization',
  email: '[email protected]',
});

// Access properties with type safety
console.log(contact.name); // "Example Organization"

// Convert to JSON
const json = contact.toJSON();

Advanced Usage

import {
  TidasProcess,
  createTidasProcess,
  validateTidasData,
} from '@tiangong-lca/tidas-sdk';

// Create and validate complex objects
const process = createTidasProcess({
  name: 'Manufacturing Process',
  description: 'Production of electronic components',
});

// Validate data
const validation = validateTidasData(process, 'Process');
if (!validation.success) {
  console.error('Validation errors:', validation.errors);
}

tidas-tools Parity APIs

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

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

XML Conversion APIs

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

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

Directory Conversion Tools

import { convertDirectory } from '@tiangong-lca/tidas-sdk/tools';

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

convertDirectory() mirrors the non-export behavior of tidas-tools convert.py:

  • converts .json -> .xml or .xml -> .json
  • copies non-converted files into output/data
  • copies the packaged schemas/, stylesheets/, or methodologies/ assets into the output root

Database export, ZIP publishing, and S3-related workflows remain in tidas-tools.

🏗️ Architecture

Module Structure

// Core imports
import {
  // Types
  TidasContact,
  TidasProcess,
  TidasFlow,
  // ... all 18 TIDAS types

  // Factory functions
  createTidasContact,
  createTidasProcess,
  createTidasFlow,
  // ... all factory functions

  // Utilities
  validateTidasData,
  convertToJSON,
  convertFromJSON,
} from '@tiangong-lca/tidas-sdk';

// Individual modules
import { TidasContact } from '@tiangong-lca/tidas-sdk/core';
import { TidasTypes } from '@tiangong-lca/tidas-sdk/types';
import { TidasSchemas } from '@tiangong-lca/tidas-sdk/schemas';
import { TidasUtils } from '@tiangong-lca/tidas-sdk/utils';

Supported TIDAS Data Types

  • TidasContact
  • TidasFlow
  • TidasProcess
  • TidasSource
  • TidasFlowProperty
  • TidasUnitGroup
  • TidasLCIAMethod
  • TidasLifeCycleModel
  • And 10 additional specialized types

🧪 Development

Setup

# Clone repository
git clone https://github.com/tiangong-lca/tidas-sdk.git
cd tidas-sdk/sdks/typescript

# Install dependencies
npm install

# Build the SDK
npm run build

# Run tests
npm test

Development Commands

# Development mode (watch)
npm run dev

# Type checking
npm run typecheck

# Linting
npm run lint
npm run lint:fix

# Formatting
npm run format
npm run format:check

# Testing
npm test
npm run test:watch
npm run test:coverage

# Build
npm run clean
npm run build

# Refresh packaged runtime assets from the upstream tidas-tools checkout
npm run sync-runtime-assets

Testing

# Run all tests
npm test

# Watch mode
npm run test:watch

# Coverage report
npm run test:coverage

📚 Examples

See the examples directory for comprehensive usage examples:

🔗 API Reference

Factory Functions

All TIDAS types have corresponding factory functions:

// General pattern
createTidas{Type}(data: Partial<Tidas{Type}>): Tidas{Type}

// Examples
createTidasContact(data)
createTidasProcess(data)
createTidasFlow(data)

Validation

// Validate any TIDAS data
const result = validateTidasData(data, 'Contact');
if (result.success) {
  // Data is valid
} else {
  // Handle validation errors
  console.error(result.errors);
}

Property Access

// Access nested properties with type safety
const contact = createTidasContact(data);
const email = contact.email; // Type: string | undefined
const address = contact.address?.street; // Type: string | undefined

📖 Documentation

🚀 Release

Normal releases are tag-driven:

# Validate the package before opening the release PR
./scripts/ci/verify-typescript-package.sh

# After the release PR merges, tag the exact merged commit
git tag typescript-vX.Y.Z
git push origin typescript-vX.Y.Z

Version prep helpers are available if you want to update package.json locally before committing:

npm run release:prepare:patch
npm run release:prepare:minor
npm run release:prepare:major

🤝 Contributing

We welcome contributions! Please:

  1. Follow the development guidelines
  2. Add tests for new functionality
  3. Ensure all tests pass and code is properly formatted
  4. Update documentation as needed

📄 License

MIT License - see LICENSE file for details.

🔗 Related Packages