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

nd-responses

v0.0.4

Published

a quick app to give nice responses to users instead of the boring old straight forward answeres. You can get random responses in special categories to give users to keep your app or site more lively

Readme

Response Module Documentation

The Response module provides an easy way to fetch all sorts responses for specific keys, languages, and sensitivities. Developed by tobi from Nous Dynasty.

Installation

If you are reading this you are most likely on nodejs.. just run

npm i nd-responses

you can then import or requires, call the class and use as you please

Usage

Importing the Module

You can import the Response class using require:

const { Response } = require('nd-responses');

or

import { Response } from 'nd-responses';

Initialization

To initialize a Response object, pass the desired language and sensitivity:

const responses = new Response('en', 'humorous');

If nothing is passed the default is english language with a normal sensitivity

  • Parameters:
    • language (optional): The language of the response, e.g., 'en' (only en for now). Defaults to 'en'.
    • sensitivity (optional): The tone or style of the response, e.g., normal' ,'detailed' ,'concise' ,'nice' ,'sad' ,'angry' ,'confused' ,'encouraging' ,'sarcastic' ,'humorous' ,'uncle' ,'sad_exaggerated' ,'dark' ,'roadman' ,'jamaican' ,'old_british' ,'viking'. Defaults to 'normal'.

Fetching a Response

Use the getResponse method to fetch a response for a given key.

(async () => {
    const response = await responses.getResponse('404');
    console.log(response);
})();
  • Method: getResponse
  • Parameters:
    • key (required): The response key, e.g., '404', 'LOGIN_ERROR_WRONG_DETAILS', 'LOGIN_ERROR_WRONG_PASSWORD'.
    • language (optional): Overrides the instance language for this request. Defaults to what what used in initialization of the class en
    • sensitivity (optional): Overrides the instance sensitivity for this request.Defaults to what what used in initialization of the class normal
  • Returns: A Promise that resolves to the response text.

Examples

Example 1: Default Language and Sensitivity

const { Response } = require('responses');
const roadmanResponses = new Response('en', 'roadman');

    try{
        ...
    }
    catch(e){
        res.send(await roadmanResponses.getResponse('LOGIN_ERROR_WRONG_DETAILS')); // would send a roadman kind of response
    }

Example 2: Custom Language and Sensitivity

const { Response } = require('./index');
const responses = new Response();

(async () => {
    const response = await responses.getResponse('404', 'en', 'viking');
    console.log(response); // Outputs a response as thought your app was run by vikings.
})();

API Overview

| Property/Method | Description | Default | |-----------------------|--------------------------------------------------------------|---------------------| | language | Language of the response (e.g., 'en', 'es'). | 'en' | | sensitivity | Tone or style of the response (e.g., 'normal', 'sarcastic', 'humorous'). | 'normal' | | getResponse(key) | Fetches a response for the provided key. Returns a Promise with the response text. | - |


Error Handling

Errors during the fetch request will need to be handled manually. Example:

const { Response } = require('./index');
const responses = new Response();

(async () => {
    let response
    try {
        response = await responses.getResponse('404');
    } catch (error) {
        console.error('Error fetching response:', error.message);
        response = // a default message
    }
})();

Contributing

Feel free to contribute to this module by improving features, fixing bugs, or suggesting new ideas. Submit your changes through My Email .


License

This module is licensed under the ASC License. See the LICENSE file for more details.