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

dogedc

v1.1.2

Published

Doge Decimal Classification

Downloads

34

Readme

Doge Decimal Classification

Node.js CI

Such classification. Many library. So fun. No Dewey. Wow.

Installation

npm i dogedc

CLI

Doge Decimal Classification now comes with a command-line interface! Amaze.

$ dogedc 123
So determinism. Many indeterminism.
$ dogedc # random class
Very international. Many law. Wow.

You'll need to install it globally (npm i dogedc -g) to get the CLI on your path.

API Usage

dogedc(classNumber, callback) — convert class from boring old Dewey Decimal Classification to exciting new Doge Decimal Classification. The callback function is passed any error as its first argument & an object as its second argument, that object has form:

{
    'classNumber': '020',
    'className': 'Library & information sciences',
    'dogeClassName': 'Many library. Such information. Very sciences.'
}

If classNumber is falsey or not present, dogedc will pick a random class number & pass that to the callback.

var dogedc = require('dogedc');

// get random Doge Decimal class
dogedc(function(err, ddc) {
    console.log('Class number:', ddc.classNumber);
    console.log('Doge class name:', ddc.dogeClassName);
});

// look up 020's class name
dogedc('020', function(err, ddc) {
    console.log('020', ddc.dogeClassName);
});

The dogedc node module also exposes a toDoge function for converting tepid plain human speak into awesome beautiful doge speak. It was written specifically for this module, so as a general-purpose doge-ifier your mileage may vary, but it's there.

var toDoge = require('dogedc').toDoge;

console.log(toDoge('Hello World'));
// logs "Many hello. Much world." or some such

Notes

The number argument passed to dogedc can be an integer or a string. It's safer to always pass strings because numbers with leading 0s are treated as base 8 in JavaScript (e.g. 020 === 16);

Right now, only top-level, 3-digit classes work.

I culled the list of Dewey Decimal Classes from the University of Illinois at Urbana-Champaign's list. If there are any errors, blame them ;)

Doge Decimal Classification is the first stochastic classification system.* Class names are randomly generated based on the corresponding Dewey Decimal Classification & well-recognized dogespeak constructions. For this module's users, that means that the resulting dogeClassName of any given class number may differ each time the module is executed.

I tried using fs.createReadStream & JSONStream to parse the Dewey JSON file but it turned out to be almost twice as slow as simply using fs.readFile. That work is on the stream branch & the testing script is at test/bench.

*…that I'm aware of.

License