
Product
Introducing the Alert Details Page: A Better Way to Explore Alerts
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.
assemblerjs
Advanced tools
A modern, type-safe, and lightweight Dependency Injection library for Node.js and Browsers π.
β¨ Universal Library: Works seamlessly in Node.js, browsers, and any JavaScript environment that supports ES2020+
reflect-metadataonRegister, onInit, onDisposeParameterDecoratorFactory and createConstructorDecoratorInstall assemblerjs and its peer dependency reflect-metadata using npm or yarn:
npm install assemblerjs reflect-metadata
yarn add assemblerjs reflect-metadata
Important: You must import reflect-metadata at the entry point of your application:
import 'reflect-metadata';
β¨ Works everywhere: This installation works for Node.js, browsers (with Vite/Webpack/Rollup), React, Vue, Angular, and any JavaScript environment.
If you want to try assemblerjs without a build step:
<script src="https://unpkg.com/reflect-metadata@latest/Reflect.js"></script>
<script type="module">
import { Assemblage, Assembler } from 'https://unpkg.com/assemblerjs@latest/dist/index.js';
// Your code here
</script>
import 'reflect-metadata';
import { Assemblage, Assembler, AbstractAssemblage } from 'assemblerjs';
// Define a service
@Assemblage()
class Logger implements AbstractAssemblage {
log(message: string) {
console.log(message);
}
}
// Define an application that depends on Logger
@Assemblage({
inject: [[Logger]], // Declare dependencies
})
class App implements AbstractAssemblage {
constructor(private logger: Logger) {}
start() {
this.logger.log('App started!');
}
}
// Bootstrap the application
const app = Assembler.build(App);
app.start(); // Output: "App started!"
Comprehensive documentation is available at:
assembler.js is optimized for tree-shaking with modular exports. Import only what you need:
// β Large bundle (imports everything)
import * as Assembler from 'assemblerjs';
// β
Optimal (only imports required modules)
import { Assemblage, Assembler, AbstractAssemblage } from 'assemblerjs';
The package uses:
"sideEffects": false - Safe to remove unused modulesEnable decorators and reflection in your tsconfig.json:
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"target": "ES2020",
"module": "ESNext",
"lib": ["ES2020"]
}
}
This package is part of the assemblerjs monorepo and depends on:
@assemblerjs/core - Internal utilities package providing:
This dependency is automatically installed with assemblerjs and transparent to end users.
# Install dependencies from workspace root
yarn install
# Build the package
npx nx build assemblerjs
# Run tests
npx nx test assemblerjs
assemblerjs/
βββ packages/
β βββ assemblerjs/ # Main DI library (this package)
β βββ core/ # Internal utilities
β βββ dto/ # DTO utilities
β βββ electron/ # Electron integration
β βββ fetch/ # Fetch utilities
β βββ mongo/ # MongoDB integration
β βββ rest/ # REST utilities
MIT
Made with β€οΈ in Marseille
FAQs
A general purpose Dependency Injection library for node and browser.
The npm package assemblerjs receives a total of 116 weekly downloads. As such, assemblerjs popularity was classified as not popular.
We found that assemblerjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.