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

@micro-lc/middleware

v3.3.1

Published

micro-lc configuration server

Downloads

118

Readme

Middleware is a backend service responsible for serving micro-lc configuration files, applying some useful parsing logic before returning their content. This logic is also distributed through an SDK to ease the process of building custom configurations serves.

On top of that, this service distributes a CLI that can be used to automatically convert micro-lc configuration files from one version to another.

For a detailed description of the service capabilities, referer to the server and CLI official documentation.


Migrating from v2 to v3

Service now provides configurations on a fixed endpoint /configurations, hence an endpoint rewrite via a reverse proxy is needed to map the old (v2) / to (v3) /configurations/.

Local development

To develop locally you need:

  • Node 18+

To set up Node, please if possible try to use nvm, so you can manage multiple versions easily. Once you have installed nvm, you can go inside the directory of the project and simply run nvm install, the .nvmrc file will install and select the correct version if you don’t already have it.

Once you have all the dependency in place, you can launch:

npm install
npm run coverage

This two commands, will install the dependencies and run tests emitting a coverage report.

To launch the service locally, ensure you don't have a .env.local file in your root folder and run:

./scripts/set-default-env.sh

From now on, if you want to change anyone of the default values for the variables you can do it inside the .env.local file without pushing it to the remote repository.

Once you have all your dependency in place you can launch:

npm run build
npm run start:local

and you will have the service exposed on your machine. In order to verify that the service is working properly you could launch in another terminal shell:

curl http://localhost:3001/-/ready

As a result the terminal should return you the following message:

{"name":"@micro-lc/middleware","status":"OK","version":"0.2.1"}

Build a Docker container

The service Docker image can be build through provided Dockerfile, running

docker build --tag microlc/middleware .

To start the container, you can use the run.sh script, running:

./scripts/run.sh

Tag

npm run bump [patch|minor|major|<version number>]

releases both the sdk on npm and the docker container on docker hub