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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tiangong-lca/tidas-sdk

v0.1.21

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

📦 Installation

npm install @tiangong-lca/tidas-sdk

🔧 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);
}

🏗️ 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

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

Automated release process:

# Patch release (x.y.Z)
npm run release:patch

# Minor release (x.Y.z)
npm run release:minor

# Major release (X.y.z)
npm run release: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