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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aszu/lazy-network

v0.5.0-1

Published

The network layer wrapper, by lazy people for lazy people.

Readme

Network layer

Created by lazy developer for lazy developers.

Axios once started as a tool for those, who were too lazy to play with fetch directly. It made it more sane by rejecting promises when the things went wrong on the server.

This module tries to move the laziness to the higher level, by wrapping some boilerplate code that I saw is usually written in each and every project.

If you're too lazy to use axios, feel free to use this wrapper.

Note: This is work in progress.

Although the interface that is exposed now (network.bootstrap and network.(get, post, ...) methods, along the waitForNetwork method will stay with us, the implementation will likely change in the future and new features will be introduced, as I identify new cases that are good candidates to be put here.

Features

Main concern is - usually - to get the network configured, either by hardcoding something in the bundle (then you end up with having multiple artifacts for multiple environments) or by getting the config in a dynamic way (usually via additional request).

This library gives you a chance to skip writting boilerplate for the latter case, still supporting the former one. Read about Bootstrap modes below.

Bootstrap modes

  1. In bundle configuration

    Network setup may be defined locally (in bundle).

    This way you can get your network up and running (almost) instantly, without unnecessary requests and delays. Awesome, isn't it? You just pass the object to the network.bootstrap method.

   import network, { BOOTSTRAP_MODE } from '@aszu/lazy-network'
   
   network.bootstrap(
     BOOTSTRAP_MODE.BOOTSTRAP_CODE, 
     { 
         endpoints: { 
             MAIN: 'http://your.server.com'
         }
     }
  1. Network setup may be provisioned by some configuration file outside the built artifact.

    This way is a good choice in case you don't mind waiting for another requests because you value "single artifact" principle more.

    This way your application will be identical on all your environments. It starts and then it requests for config.json file, which contains all your goodies.

    All you have to do to get your config.json for given environment deployed along your bundle.

  2. Network can be bootstrapped by external JS call.

    Actually, I use this mode when creating things like admin modules or similar. This way you can bootstrap your admin module and then use some hook or something else to bootstrap the network layer.

    I like this approach as I have single configuration-less build of my admin module - and it just works when you drop it onto deployment.

Promise backed and quaranteed

  1. You can shoot your requests before the network got bootstrapped.

    There is a "no requests lost" due to lack of configuration approach. You will get your GET or POST promise and it will get resolved eventually.

    For MAIN endpoint this is just given. For other endpoints, this might not be given out of the box, as the proxy objects are not the thing that can be trusted now. For that reason you will have at least declare list of your endpoints before you can send requests to there.

    It is as simple as network.declareEndpoints('CARDS', 'AUTH') though.

Known issues

  1. There is no typescript module (yet). Sorry. :)