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

curated-node

v1.0.8

Published

Not a framework. Not a module. Just a bunch of Node.js packages you most likely familiar with and probably already use, bundled together in a modular fashion.

Downloads

4

Readme

Curated [Node]

npm NPM npm

Not a framework. Not a module. Just a bunch of Node.js packages you most likely familiar with and probably already use, bundled together in a modular fashion.

Introduction

What is this?

An arsenal of classes composed of npm packages and code snippets, grouped by use-cases and offered as neatly structured classes of reusable functionalities and resources, aiming to reduce the amount of code you need to type to get stuff done, without a 'framework-ish' learning curve. I initially wrote these classes to practise object-oriented TypeScript, but I use it in production apps today.

Who asked for this and why?

I did. With this package alone, one can quickly deploy a HTTP/Socket.IO server with persistence and task management with much less boilerplate code, but that's not the catch...

All major versions will maintain structure and function signatures all through their lifespan. I've structured it this way to escape having to refactor 20 codebases with similar code.

How do I use this?

Read the class sources after the base documentation in this guide, and if you like them, feel free to use all or any them. If you don't like an implementation, simply import and extend the concerned class to override the concerned methods in your code.

Documentation

I'll try to offer more detailed docs on each class in this package, but until then, read the code and decide what you want to use.

Installation

Unless you have a reason to use this repo directly, simply install from npm registry...

npm install curated-node

Package structure

This is not a module. For fluidity, all kernels, modules and services are offered as classes. There are no states/instances, factories or dependency injections. The classes are relatively coupled, but you decide when to extend or create instances.

For maintainability and ease-of-use, separation of concerns is favoured over classification by context in architecture of classes. Every component is granularly crafted or at least I've tried to make it so.

Features

TypeScript

It's all written in TypeScript for easy consumption. I aim to strongly type every bit of this codebase. If I've missed something so far, I'll eventually find and slap a type on it.

Bundles

  • Components

    Components are classes tailored for functionalities that complete other bundle components and more. They have no base classes.

    • ExpressRouterWrapper - A wrapper for organising your Express server routes and concerns.
    • GracefulSignalShutdown - Helps with signal-based graceful exit.
    • SocketIONamespace - A wrapper for using Socket.IO namespaces to separate concerns.
  • Kernels

    Kernels are bootable bundle classes. They extend the abstract _BaseKernel class, to offer boot() and halt() methods. The halt method will return true if kernel was gracefully halted, and false otherwise.

    • ExpressKernel - Creates an Express server.
    • SocketIOKernel - Creates a Socket.IO server that can be attached to an Express server or bound directly to a port.
  • Modules

    Modules are component bundle classes. They extend the abstract _BaseModule class.

    • LogModule
    • RabbitMQModule
    • RedisModule
    • SessionModule
  • Providers

    Providers are helper classes that offer data, whether implicitly generated or obtained from external resources. They also have no base classes.

    • GeolocationProvider - Countries, states and primary currency, so you don't need to store the static data in the database of every app you make, or rely on network-provided data, which can fail and leave your users with bad UX.
    • CurrencyProvider - Currencies, their symbols and names.
  • Utils

    Utils are helper classes that offer stateless routines. They also have no base classes.

    • FunctionUtils
    • ObjectUtils
    • PromiseUtils
    • StringUtils

Coding conventions

  • Class names are Pascal-cased
  • Class members are camel-cased
  • Private class properties have an underscore prefix
  • Class properties are made public with getters/setters with the leading underscores removed
  • Abstract classes have an underscore prefix