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

openwhisk-js-utils

v1.0.1

Published

Some js utils to help interact with OpenWhisk via the official SDK

Readme

openwhisk-js-utils

Some js utils to help with tasks not offered as part of the official SDK

This is really just a very lightweight helper for the official SDK. It's not a wrapper per se, but rather provides a few handy abstractions for workflows I find myself using a lot.

Install

$ yarn add openwhisk-utils

or

$ npm install --save openwhisk-utils

Environment

I try to write code directly for nodejs6 without needing a transpiler.

Usage

You can either initialise the entire utils package or on a per-function basis.

a) Via initialisation function:

const openwhisk = require("openwhisk")();

const owutils = require("openwhisk-utils")(openwhisk);
owutils.actions.create(actionLocation).then(...);

b) Per-function basis

const openwhisk = require("openwhisk")();

const osactions = require("openwhisk-utils").actions;
actions.create(openwhisk, actionLocation).then(...);

Creating Actions

This just helps wrap a workflow for zipping up an npm package and uploading it to OpenWhisk. It also handles js files as is.

NB The location must be an absolute path. For relative links use let location = require('path').join(__dirname, "./relative/location");

Function signature

ow_utils.actions.create(absolutePath, options={});

Options

Custom Name

Actions are by default named after the js file or the directory name of the package. If you wish to specify a name use

{
    actionName: "myName"
}
Deleting Existing Action

You can delete the action first if it exists. This makes it easier to overwrite actions.

{
    clean: true
}
Default params

NB This is not supported officially by the SDK at the time of writing. I hacked my openwhisk to allow it, but there is a pull request to fix this.

params: {
    "a": 1,
    ...
}
Yarn vs Npm Install

By default, dependencies are installed via npm install, but you can also choose to use yarn instead:

{
    yarn: true
}

Examples

Overwrite action from JsFiles
const jsfile = "/some/js/file.js"
ow_utils.actions.create(jsfile, {clean: true}).then(...);
NPM Package built via Yarn with some default params

Given a package at /some/npm/package/ which looks like the below, this will install the dependencies and then zip the directory ready for upload.

/some/npm/package/
  |-  index.js
  |-  package.json
  |-  yarn.lock

We'll also add some default params:

const npmDir = "/some/npm/package"
ow_utils.actions.create(npmDir, {
    yarn: true,
    params: {"redis_host": "redis.example.com"}
}).then(...);

Testing

I haven't got round to mocking the openwhisk requests, so at the moment there is just a test/manual-test.js file which you can use to verify it works for yourself. Sorry, I know, bad form.

License

MIT © [Alastair Brayne]