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

push-wrapper

v2.3.1

Published

A wrapper for the Ableton Push to give easy to use APIs for controlling/being controlled by the Push

Downloads

20

Readme

push-wrapper

What?

A javascript wrapper enabling use of the Ableton Push (mk1) hardware as a MIDI controller in a Web MIDI/Audio API enabled environment

The wrapper presents a simple API that abstracts the generation and parsing of MIDI messages sent to/from the hardware.

How to use it

push-wrapper is distributed via npm as both:

  • a UMD module
  • an ESM module

The code is written using javascript ES2015/ES6 so expects native Promises and other newer language features to be available.

In browser

Add push-wrapper to your (npm) project

npm install push-wrapper

With support for ESM modules

Assuming your application lives in a file public/index.html, copy the distributed push-wrapper ESM module into place:

cp -r node_modules/push-wrapper/dist/esm public/esm

Then use it in your app:

<script type="module">
  import pushWrapper from './esm/push-wrapper.js'

  const push = pushWrapper.push()
  push.onMidiToHardware(console.log)
  push.button('TapTempo').ledOn() // prints [176, 3, 4] to console
</script>

Without support for ESM modules

Assuming your application lives in a file public/index.html, copy the distributed push-wrapper UMD module into place:

cp -r node_modules/push-wrapper/dist/umd public/umd

Then use it in your app:

<script src="umd/push-wrapper.js"></script>
<script>
  const push = pushWrapper.push()
  push.onMidiToHardware(console.log)
  push.button('TapTempo').ledOn() // prints [176, 3, 4] to console
</script>

Note that push-wrapper can also be used in the browser as an ASM module via libraries such as requirejs

In browser via a bundler

If you are writing your application and bundling it for the browser (e.g. using Rollup) then add push-wrapper to your (npm) project

npm install push-wrapper

Then use it in your application's source code (before bundling/transpilation) as an ESM module

import pushWrapper from 'push-wrapper'

const push = pushWrapper.push()
push.onMidiToHardware(console.log)
push.button('TapTempo').ledOn() // prints [176, 3, 4] to console

Then let your bundler transpile those import statements into an inline version of the code

Note that the UMD distribution of push-wrapper can be used in your project (before bundling/transpilation) as a commonjs module via require statements if you prefer

In node

Add push-wrapper to your (npm) project

npm install push-wrapper

Then use it via

const pushWrapper = require('push-wrapper')

const push = pushWrapper.push()
push.onMidiToHardware(console.log)
push.button('TapTempo').ledOn() // prints [176, 3, 4] to stdout

Modification & Running tests

If you want to modify the wrapper, install its dependencies and run its test suite by:

npm install
npm test