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

niffler-item-stock-reducer-subscriber

v1.0.1

Published

Niffler item stock reducer subscriber

Downloads

1

Readme

Niffler item stock reducer subscriber

Susbcriber that listen to the order created event in Niffler Nats Queue to get the shopping cart , and one by one reduce stock in our Stock Redis Database.

Installation

In order to get this project work, the first step is to get all configuration files needed for running (for example the .env file)... and for do that run the following command in the terminal to get via consul all the required files.

Notes: We encourage you to all the config files sensitive data keep in the config folder, because following this "practice" will keep just one folder to treath this kind of data , and will be easy to mantain.

# extract all the environment files needed to running the project 
# note: you need a valid consul token with access
gulp config #-t YOUR_CONSUL_TOKEN

Tip: All the configuration for treath the sensitive data keep in docker/config.hcl... so if you want to add more files or configurations, now you know what is the file that you need to edit ^^.

Docker

Simply and solid... just run the following command if you want to run inside a container docker.

Notes: To keep the same "drone pipeline", you need to create a .docker.env in the root directory with at least two required environment variables:

  • DOCKER_CONSUL_TOKEN: Consul Token with access to extract the configuration.
# docker build in interactive mode
docker build . && \
# docker run (if you want get inside the docker just append /bin/bash)
# the K8S_ENVIRONMENT is assigned in the k8s deployment via env args
docker run --env K8S_ENVIRONMENT=development --rm -it $(docker build -q .)

Gulp tasks

We use gulp as a task runner for a bunch of useful process, like for example:

  • "config": Download and extract all configuration files from consul inside the /config files, like .env files, certificates, secrets or all kind of sensitive data.
  • "validate": Some validation stuff like linting and things like that.
  • "docs": Build the Readme.md doc dynamically.
  • "build": Transpile the code from Typescript to Javascript.
  • "run": Run the code with nodemon to track the changes for ts files.
  • "publish": Publish the code (bump version and tagged), also build the Readme.md.

An example of running the validate task is easy as running the following command in your terminal:

# validate project
gulp validate

Subscriber manifiest

| docker | version | latest build | | --- | --- | --- | --- | | niffler-item-stock-reducer-subscriber | 1.0.0 | 2020-06-11T20:36:22.365Z |