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

@codrjs/config

v1.0.7

Published

Codr configuration, unified

Downloads

3

Readme

@codrjs/config

npm version CodeQL

Purpose

This repository is a custom-built configuration manager for all repositories. This module manages everything configuration and should be used in all projects manages so that environment variables are unified, making transitioning development from one domain to another easy.

Getting started

Install the package from the npm registry.

yarn add @codrjs/config

Import the config package and use the variables you need!

*Please note: This package assumes you have defined the environment variables you are accessing and does no error checking.*

/* Import the config package */
import config, { ExpressConfig } from "@codrjs/config";
import { express } from "express";

const app = express();

app.listen(config.express.port, config.express.host, () => {
  console.log(
    `Server is starting on ${ExpressConfig.host}:${ExpressConfig.port}`,
  );
});

Environemnt Variable Names

Location of environment variable is postfixed to Config.{location} (e.g. Config.express.host).

| Env var | Location | Description | | --------------------------- | ------------------------------- | --------------------------------------------------------------------------------------- | | ENV | env | Deployment envionment - dev, qa, stage, prod | | HOSTNAME | hostname | Deployment docker hostname | | Provided via npm | name | Deployment service name - example: codr-user-user | | Provided via npm | version | Deployment version - example: 1.0.0 | | AWS_REGION | aws.region | AWS - deployment region | | AWS_SES_API_VERSION | aws.ses.api.version | AWS SES - api version | | AWS_SES_ACCESS_KEY | aws.ses.access.key | AWS SES - IAM access key id | | AWS_SES_ACCESS_SECRET | aws.ses.access.secret | AWS SES - IAM access key secret | | CODR_USER_AUTH_SVC_URL | codr.svc.user.auth | Codr - user authentication service | | CODR_USER_PROFILE_SVC_URL | codr.svc.user.profile | Codr - user profile entity service | | CODR_USER_SESSION_SVC_URL | codr.svc.user.session | Codr - user session entity service | | CODR_USER_USER_SVC_URL | codr.svc.user.user | Codr - user entity service | | EMAIL_FROM | email.from | Email - from address | | EMAIL_REPLY_TO | email.replyto | Email - reply to address(es) | | EXPRESS_HOST | express.host | Express server - listener host | | EXPRESS_PORT | express.port | Express server - listener port | | GIT_BRANCH | git.brach | Git - branch | | GIT_COMMIT | git.commit | Git - commit sha | | GIT_REPO | git.repo | Git - repository | | JWT_ALGORITHM | jwt.algorithm | JWT - algorithm, default HS256 | | JWT_SECRET | jwt.secret | JWT - secret, key to decode jwt, must be the same across all services in an environment | | JWT_ISSUER | jwt.issuer | JWT - issuer, default codrjs.com | | KAFKA_BROKERS | kafka.brokers | Kafka server - comma seperated locations of the kafka brokers | | KAFKA_CLIENT_ID | kafka.clientId | Kafka server - name of the kafka cluster | | KAFKA_CONSUMER_GROUP | kafka.consumer.group | Kafka server - consumer group | | MONGO_URI | mongo.uri | MongoDB - server URL, please include username and password to this string | | NODE_ENV | node.env | Node environment - development, production, testing | | Provided via npm | node.verison | Node version - example: 16.19.1 | | Provided via npm | node.modules | Node modules - string array of all dependencies | | Provided via yarn | node.yarnVersion | Node - package manager version | | OPENAPI_INFO_TITLE | openapi.info.title | OpenAPI - documentation title | | OPENAPI_INFO_DESC | openapi.info.description | OpenAPI - documentation description | | OPENAPI_SERVER_ONE_URL | openapi.server[0].url | OpenAPI - server one url | | OPENAPI_SERVER_ONE_DESC | openapi.server[0].description | OpenAPI - server one description | | OPENAPI_SERVER_TWO_URL | openapi.server[1].url | OpenAPI - server two url | | OPENAPI_SERVER_TWO_DESC | openapi.server[1].description | OpenAPI - server two description | | OPENAPI_SERVER_THREE_URL | openapi.server[2].url | OpenAPI - server three url | | OPENAPI_SERVER_THREE_DESC | openapi.server[2].description | OpenAPI - server three description | | OPENAPI_SERVER_FOUR_URL | openapi.server[3].url | OpenAPI - server four url | | OPENAPI_SERVER_FOUR_DESC | openapi.server[3].description | OpenAPI - server four description | | OPENAPI_SERVER_FIVE_URL | openapi.server[4].url | OpenAPI - server five url | | OPENAPI_SERVER_FIVE_DESC | openapi.server[4].description | OpenAPI - server five description |

TODO

  • [ ] ...

Contributing

# Clone the repo
git clone [email protected]:CodrJS/config.git

# Install yarn if you don't have it already
npm install -g yarn

# Install dependencies, build, and test the code
yarn install
yarn build
yarn test