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

humanify

v2.2.27

Published

Allows adding human input to data streams in node.js

Downloads

36

Readme

Humanify Logo FOSSA Status

What does it do?

Humanify is a free and open source server and web application, written in Node.js, that allows adding human intelligence to data streaming in scenarios where computers are not suitable to make educated enough choices.

In just a couple lines of code Humanify will ingest your data stream, open an HTTP server with a WebApplication that will be fed with all the data from the stream. Now you and your team can add decisions to each item of your data stream.

Think of it as an open-source, on-premise alternative to Amazon Mechanical Turk that you can alter to your own liking.

Usage

npm install -s humanify

With scramjet stream:

    streamOfRequests.use("humanify", {buttons: [
        {value: 0, caption: 'Remove', type: 'danger', kb: ['rR', 39]},
        {value: 2, caption: 'Escalate', type: 'warning', kb: ['eE', 38]},
        {value: 1, caption: 'Accept', type: 'success', kb: ['aA', 37]},
    ]})
    // do something with your data-stream

With any other node.js stream:

    import humanify from "humanify";

    humanify(streamOfRequests, {buttons: [
        {value: 0, caption: 'Remove', type: 'danger', kb: ['rR', 39]},
        {value: 2, caption: 'Escalate', type: 'warning', kb: ['eE', 38]},
        {value: 1, caption: 'Accept', type: 'success', kb: ['aA', 37]},
    ]})
    // do something with your data-stream

The app will show at: http://localhost:8666/

This results in an app like this:

Humanify App Screenshot

API

Humanify is a Scramjet Module and you can use it with any stream.

Options are:

  • serialize - serialization method for your data (default: JSON.stringify)
  • deserialize - serialization method for your data (default: JSON.parse)
  • port - the port on which the humanify app should listen on (default: 8666)
  • host - the host on which the humanify app should listen on (default: 0.0.0.0)
  • base - a path on which humanify app should be exposed (useful if you'd like a couple instances)
  • root - root path for application to start (default: public folder in humanify root)
  • buttons - list of buttons that are show to users
  • maxBufferLength - how many items to show to users
  • logger - logger to use, default: {[*]: mute}
  • itemParser - an async function that allows to enrich entries just before sending them to the application

Additionally you could also pass an option to reuse an existing server:

{server: {
    app,    // the express-compatible app to hook middleware on
    io,     // the socket.io server instance
    http    // the http server humanify should hook up to.
}}

Button definition:

    {
        value: 1,           // the value that's pushed to the output stream
        caption: 'yes',     // what should be shown on the buttons
        type: 'primary',    // bootstrap type (in essence it's the button's class)
        kb: ['yY', 37]      // keyboard scan code to assign as shortcut
    },

itemParser:

// this is called just before the item is sent to the browser app.
function({buttons, item}) {
    // buttons is an array of buttons
    // item - the original data in stream

    return {buttons: newButtons, item: await getSomeMoreData(item)}
    // all returned
}

Samples

Samples are in the test directory, try to run them like this:

node test/sample-comments.js

Then run the browser, point it to http://localhost:8666/ and push some buttons there. In console you'll see the effect of your choices:

16:39 $ node test/sample-comments.js
REQUESTING CONTACT    : <Sequoyah Miina> "Ad quorum et cognitionem et usum iam corroborati natura ipsa praeeunte deducimur. Cuius ad naturam apta ratio vera illa ..."
SENDING 'THANK YOU'   : <Deimos Bengta> "Omnia peccata paria dicitis. Nam quibus rebus efficiuntur voluptates, eae non sunt in potestate sapientis. Illa argument..."
REMOVING FROM FACEBOOK: <Aoibhín Cătălin> "Illa argumenta propria videamus, cur omnia sint paria peccata. Eam tum adesse, cum dolor omnis absit; Si quicquam extra ..."

Plans

  • Extract the data front-end library from sample app
  • Make a better sample application
  • Fix application to be more flexible and use some kind of templating system.
  • Add web notifications support with options via service workers

License

Humanify is licensed as MIT. See LICENSE file in this repo.

FOSSA Status