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

bring-modules

v0.0.10

Published

Bring your node.js modules to life

Downloads

4

Readme

                                 .("""")                                      (j)
                               (_(_ __(_ )                                 (n o d e)
 _ _ _       _                   / / /                       (n)              (s)
 ))`)`) ___  )L __ __           / / /           n            \|/              \|/
((,(,' ((_( (( (('(|             n             \|/            |                |

Bring

Preamble

Node water to bring your node.js modules to life.

So What Does it Do?!

"Bring" follows an inversion of control pattern similar to Java Spring. It helps you easily build applications from modules which you link together using configuration, not code.

At runtime Bring reads your configuration file(s) and instantiates the modules that are specified. It sets options, calls functions on those modules and can pass refences between them or to your main application. Using bring you can have an application bootstrapped, up and running almost entirely by configuration. This is great if you want to "mix" different varients of your application or run your application with different configurations in different environments.

For example:

var bring = require('bring-modules');
bring.autoconfigure();

Your application is now running!

The Config File

Bring configuration is a JSON object in the following format.

Top Level

At the top level there are three sections, require, construct and templates.

config = {
  "require" :   required-modules,      //required. (see Requiring Modules)
  "construct" : constructors,          //required. (see Constucting Modules)
  "templates" : template-constructors  //optional. (see Templates)
}

Requiring Modules

required-modules = {
  "<module-name>": module-options,
  ...    
}

module-options = {
  "depends": ["<module-name>", ...],
  "real-name": "<module-real-name>"
}

Effectively this a wrapper for the require() function with a few extra options:

  • required-modules - Object. With 1..* properties:

    • <module-name> - Object. Modules are stored for later use to module-names need to be unique. Unless real-name is also give, module-name is also the string passed to require e.g. require('<module-name>').
  • module-options - Object. With 2 properties:

    • depends - Array. Lists the module-names that should be loaded before this module.
    • real-name - String. If you need to give a module your own name use this option. Make module-name the name you want to use it and real-name is the name you would normall pass to the require() function.

Constucting Modules

constructors = {
  "< >":  ,
  ...    
}

TODO

Templates

template-constructors = {
  "< >":  ,
  ...    
}

TODO