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 🙏

© 2024 – Pkg Stats / Ryan Hefner

vkg-dice

v0.0.31

Published

An experimental mix of Dependency Injection and Cerealization (DICE).

Downloads

11

Readme

Dice

An experimental mix of Dependency Injection and Cerealization (DICE).

Class annotations:

  • @singleton: declares class as singleton, ensuring exactly one instance (if multiple containers exist, they will not share singleton instances)
  • @dice: declares class as non-singleton.

Field injection annotations:

  • @contains: declares the field with a "has-a" relationship, meaning the field will be automatically instantiated (therefore only works for @dice typed fields) when the parent object is instantiated
  • @provides: similar to @contains, but also makes the field accessible to child dices via @requires
  • @requires: declares the field as an external dependency, which will be auto-injected

Serialization can be done by using the Serializer class (get it via @requires or container.resolve(Serializer)):

  • Fields marked as @persistent() will be serialized
  • Fields marked by @contains and @provides will be recursively serialized
  • Fields marked by @required are not serialized, but will be automatically injected upon deserialization
  • Unmarked fields will be ignored
  • Upon serialization, the snapshot() method will be called, if defined. The return value will then be serialized. This gives you the chance to create a custom serialization logic in case the above features are not enough

Development notes

Deployment

run the following:

npm install
npm run build
npm publish

Development

Commands to know:

npm run watch
npm run coverage

Sonar Setup

  • Install SonarLint extension in VS Code

  • Download SonarQube Docker image and run it locally

  • Go to localhost:9000, login as admin/admin, create project named "TDS Engine" and create a token

  • Put the following in your global VS Code settings (not in project settings!):

      "sonarlint.connectedMode.connections.sonarqube": [
        {
          "serverUrl": "http://localhost:9000",
          "token": "XXXXX"
        }
      ],
  • To analyze the project, run (put your password if you changed it):

    sonar-scanner.bat -D"sonar.projectKey=TDS-Engine" -D"sonar.sources=." -D"sonar.host.url=http://localhost:9000" -D"sonar.login=admin" -D"sonar.password=admin"`

Karma test

npx karma start