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

@wal-li/core

v1.2.0

Published

Build Secure, Scalable, and Smart Servers with Ease.

Downloads

71

Readme

@wal-li/core

Pre-requisites

Make sure your project has:

  • Node.js 18+.
  • reflect-metadata package.

If you're using typescript, make sure tsconfig is match with this:

{
  "compilerOptions": {
    "module": "CommonJS",
    "target": "ES2020",
    "esModuleInterop": true,
    "strict": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true
  }
}

Getting Started

npm i -D @wal-li/core

Example

import { Container, Server, Start } from '@wal-li/core';

const container = new Container();

container.register(Server);

container.execute(Start);

const server = container.resolve<Server>(Server);

Features

Dependency Injection

TBD

Security

ID Generator

As computational power increases, random IDs tend to become longer to enhance security. However, this does not guarantee protection. Random IDs can still be exposed through various risks, and once compromised, they are difficult to secure again. Therefore, random IDs are not always necessary, especially for internal systems.

Sequential IDs provide several advantages over random ones. Although they are predictable, we can protect them through additional mechanisms such as passwords, encrypted keys, or access tokens.

  • Short and compact
  • Naturally sortable

With proper design, sequential IDs can be used safely in distributed systems without collisions, using techniques like unique machine identifiers, timestamps, or sequence generators.

In @wal-li/core, we use a 64-bit sequential ID, defined as follows:

[ 1-bit  ][ 42-bit  ][  10-bit  ][ 10-bit ]
(sign bit)(timestamp)(machine id)(sequence)

| Field | Space | | ---------- | -------------- | | sign bit | 1 (always 0) | | timestamp | 139 years | | machine id | 1024 machines | | sequence | 2048 ids |

import { uniqid } from '@wal-li/core';

uniqid();

uniqid.machine = 6;
uniqid.epoch = +new Date();

uniqid();

Server

Create

TBD

Routing

  • Static Routes: /abc/def.html.
  • Dynamic Routes: /abc/[tag]-[group]/[name].[ext].
  • Group Routes: /abc/(group)/def.html - The group segment is ignored, /abc/def.html is matched.
  • Catch-all Routes: /abc/[...slug] - Everything after the /abc/ segment is captured in the slug variable.
  • Optional Catch-all Routes: /abc/[[...slug]] - Everything after the /abc/ segment is captured in the slug variable.
    • If the path is /abc, the slug will be undefined.
    • If the path is /abc/, the slug will be empty ('');

FAQ

Why not using vitest?

Vite uses ESBuild which doesn't support "emitDecoratorMetadata" in tsconfig, since ESBuild doesn't have its own type system implemented. (https://stackoverflow.com/questions/68570519/why-cant-reflect-metadata-be-used-in-vite)

Why CommonJS?

TypeScript with ESM doesn't satisfy the requirements of the framework and related products, such as Jest and Isolated-VM. So, CommonJS it is.

License

MIT.