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

@ricardofuzeto/ws-core

v0.2.0-7

Published

Web service core library

Downloads

32

Readme

Warning note

This library is still under development. We do not recommend using it yet since its features and/or interfaces might change in a nightly basis.

Also, it has not been tested properly yet. Test cases are still being designed as the library evolves, so its stability can't be guaranteed for now.

If you still want to use it, consider checking this library's behavior when debugging your project.

About

Implementation of minor helper features that assist setting up a project from scratch.

This library provides the following features:

  • Easy sharing of environment variables via centralized context objects;
  • Easy configuration of environment variables using a JSON file;
  • Augmented logging methods that help troubleshoot problems in the logs visually.

Library capabilities

Setup

When using this library, it assumes you will need the context sharing and management across your application. Thus, it requires that you create a value where it can read environment values from, even if it's an empty file.

To do so, create a file application.json in your project's root. You can specify any environment configuration values you want inside it, and the library will define a set of static properties storing these values in memory. If everything is ok, you will see a log message telling that every single property defined in your application.json file was created in memory as a bean.

Getting a context property

To access context properties, use the context.properties object:

const { context } = require('@ricardofuzeto/ws-core');
// context.properties

// or...
const { properties } = require('@ricardofuzeto/ws-core').context;
// properties

The property object has several methods to handle context itself. To read properties, use get:

context.get('envVar'); // some value

context.get('envVar').innerProperty; // some other value

Setting a new property

In order to set a new property in the application's context, use the add method:

properties.add('prop1', 'value');
properties.get('prop1'); // value

properties.add('prop2', { value: 'some value' });
properties.get('prop2'); // { value: 'some value' }

Here we have a very important concept to pay attention: all context properties are unique and final. This means there can't be two properties with same name, and once you assign a value to them it won't change.

Augmented logging

The following example shows how to use the library's augmented logging:

const { log } = require('@ricardofuzeto/ws-core');

// Regular style
// [DD/MM/YYYY h:mm:ss][LOG] some text
log.LOG('some text');

// Bold yellow text
// [DD/MM/YYYY h:mm:ss][WARNING] some text
log.WARNING('some text');

// Bold red text
// [DD/MM/YYYY h:mm:ss][ERROR] some text
log.ERROR('some text');

// Bold white text with red background
// [DD/MM/YYYY h:mm:ss][ERROR] some text
log.ERROR_FATAL('some text');

Contributors

Ricardo Fuzeto (email): idea conception and initial development stages