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

@assemblerjs/core

v0.9.8

Published

Internal utilities package for the AssemblerJS ecosystem.

Readme

@assemblerjs/core

Internal utilities package for the AssemblerJS ecosystem.

Overview

@assemblerjs/core provides shared utilities used across all AssemblerJS packages. When building applications with assemblerjs, you'll commonly need to import utilities from this package, such as Task and other helper types.

This package is automatically installed as a dependency of assemblerjs, but it's designed to be imported directly in your code alongside the main library.

What's Inside

This package contains commonly used utilities:

  • Task - Async task utilities for concurrent operations
  • Type utilities and helpers - Generic TypeScript types and type guards
  • Collection management - Utilities for working with arrays, maps, and sets
  • Error handling - Custom error classes and error utilities
  • Conditional utilities - Helper functions for conditional logic
  • Array manipulation - Enhanced array operations

Installation

This package is automatically installed as a dependency when you install assemblerjs:

npm install assemblerjs
# @assemblerjs/core is installed automatically

You can also install it independently if you only need the core utilities:

npm install @assemblerjs/core
# or
yarn add @assemblerjs/core

Usage

When building applications with AssemblerJS, you'll commonly import utilities from this package:

import { Task } from '@assemblerjs/core';
import { Assemblage, Assembler, AbstractAssemblage } from 'assemblerjs';

@Assemblage()
class MyService implements AbstractAssemblage {
  async processItems(items: string[]) {
    // Use Task for concurrent operations
    const results = await Task.all(
      items.map(item => this.processItem(item))
    );
    return results;
  }

  private async processItem(item: string) {
    // Process individual item
    return item.toUpperCase();
  }
}

Common Exports

// Task utilities for async operations
import { Task } from '@assemblerjs/core';

// Type utilities
import { /* type helpers */ } from '@assemblerjs/core';

// Collection utilities
import { /* collection helpers */ } from '@assemblerjs/core';

Method Decorators

@assemblerjs/core also exports method decorators, including Await.

import { Await } from '@assemblerjs/core';

Await delays method execution until a condition becomes truthy.

Await(
  condition: string | ((instance?: any) => boolean | Promise<boolean>),
  interval?: number
)
  • condition can be:
    • the name of a boolean property (example: 'ready')
    • the name of a sync/async method returning a boolean (example: 'isReady')
    • a standalone sync/async function that may ignore the instance parameter
  • interval is the polling interval in milliseconds (default: 25)

Examples:

class Service {
  ready = false;

  @Await('ready')
  async start() {
    return 'started';
  }
}

class AnotherService {
  private connected = false;

  isConnected() {
    return this.connected;
  }

  @Await('isConnected', 10)
  async fetch() {
    return 'ok';
  }
}

let featureEnabled = false;

class ExternalConditionService {
  @Await(async () => featureEnabled)
  async run() {
    return true;
  }
}

For Contributors

Development

# Build the package
npx nx build core

# Run tests
npx nx test core

# Lint
npx nx lint core

Package Dependencies

This package is a dependency of:

  • assemblerjs - Core DI library
  • @assemblerjs/electron - Electron integration
  • @assemblerjs/mongo - MongoDB integration
  • @assemblerjs/rest - REST framework

Architecture

As an internal package, @assemblerjs/core follows these principles:

  • Zero external dependencies - Keeps the dependency tree minimal
  • Pure utilities - No side effects or global state
  • Tree-shakable - Optimized for bundle size
  • Type-safe - Full TypeScript support

License

MIT


Part of the AssemblerJS monorepo