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

create-digitaltwin

v0.6.2

Published

Create digital twin app within a command with templates, env etc.

Readme

create-digitaltwin

TypeScript CLI tool to create Digital Twin applications with digitaltwin-core.

Features

  • Interactive Setup - Guided prompts for project configuration
  • Database Support - SQLite (dev) and PostgreSQL (prod) options
  • Storage Options - Local filesystem or OVH Object Storage
  • Queue Management - Redis support for production workloads
  • Docker Ready - Optional Docker and docker-compose configuration
  • Example Components - Pre-built IoT sensor collector and data processor
  • TypeScript First - Full TypeScript support with strict typing
  • CLI Integration - Includes digitaltwin-cli for component generation

Quick Start

Via npm init (Recommended)

npm init digitaltwin my-digital-twin
cd my-digital-twin
npm install
npm run dev

Via npx

npx create-digitaltwin my-digital-twin
cd my-digital-twin
npm install
npm run dev

Via yarn create

yarn create digitaltwin my-digital-twin
cd my-digital-twin
yarn install
yarn dev

Via Global Installation

npm install -g create-digitaltwin
create-digitaltwin my-digital-twin

Usage

create-digitaltwin [project-name]

The CLI will guide you through configuration options:

Note: You can use npm init digitaltwin as a shorthand for npx create-digitaltwin thanks to npm's init command aliasing.

  • Project Name: Name for your Digital Twin application
  • Database: SQLite (file-based) or PostgreSQL (production-ready)
  • Storage: Local filesystem or OVH Object Storage (S3-compatible)
  • Redis: Enable for distributed queue management
  • Docker: Include Docker configuration files
  • Examples: Include sample IoT components

Generated Project Structure

my-digital-twin/
├── src/
│   ├── index.ts                 # Main application entry
│   └── components/             # Example components (optional)
│       ├── jsonplaceholder_collector.ts
│       └── index.ts
├── package.json                # Dependencies and scripts
├── tsconfig.json              # TypeScript configuration
├── .env                       # Environment variables template
├── .gitignore
├── README.md                  # Project-specific documentation
├── dt.js                      # CLI wrapper for digitaltwin-cli
├── Dockerfile                 # Docker configuration (optional)
├── docker-compose.yml         # Multi-service setup (optional)
└── dist/                      # Compiled JavaScript (after build)

Example Components

When enabled, the generator includes working example components:

JSONPlaceholderCollector

  • Fetches real data from the JSONPlaceholder API (posts and users)
  • Runs every 15 seconds to demonstrate scheduled data collection
  • Includes error handling and performance metrics
  • Shows how to integrate with external REST APIs
  • Stores collected data with metadata in your configured storage

Generated Endpoints:

  • GET /api/jsonplaceholder - Latest collected data from JSONPlaceholder

CLI Integration

Each generated project includes dt.js, a wrapper that calls digitaltwin-cli for component generation:

# Generate components after project creation
node dt make:collector WeatherCollector --description "Collects weather data"
node dt make:handler ApiHandler --method post
node dt make:harvester DataProcessor --source weather-collector
node dt make:assets-manager ImageManager --content-type "image/jpeg"

This provides seamless component scaffolding within your Digital Twin project.

Development

Building from Source

git clone <repository-url>
cd create-digitaltwin
npm install
npm run build
npm link

Development Mode

npm run dev my-test-project

Scripts

  • npm run build - Compile TypeScript to JavaScript
  • npm run dev - Run in development mode with tsx
  • npm start - Run compiled CLI
  • npm run prepare - Pre-publish build hook

Digital Twin Architecture

Projects generated by this CLI follow the digitaltwin-core architecture:

  • Collectors: Fetch data from external sources on schedules
  • Harvesters: Process and transform collected data
  • Handlers: Expose HTTP endpoints for real-time operations
  • Assets Managers: Manage file uploads with metadata
  • Engine: Orchestrates all components with Redis queues

Environment Configuration

Generated projects include comprehensive environment validation:

// Automatic validation of required environment variables
const env = Env.validate({
  PORT: Env.schema.number({ optional: true }),
  DB_HOST: Env.schema.string(),
  STORAGE_PATH: Env.schema.string({ optional: true }),
  // ... more validations based on your choices
})

TypeScript Support

This CLI is built with TypeScript and generates fully-typed projects:

  • Strict typing for all configuration objects
  • Interface definitions for sensor data and processing results
  • Type-safe environment variable validation
  • IDE support with full IntelliSense

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure TypeScript compilation passes
  5. Submit a pull request

Related Projects

License

MIT © Hoffmann Axel