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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-zephyros

v0.2.2

Published

Node.js adapter for [Zephyros](https://github.com/sdegutis/zephyros) - the OS X window manager for hackers.

Readme

node-zephyros Build Status

Node.js adapter for Zephyros - the OS X window manager for hackers.

Zephyros Demo

Usage

Include node-zephiros in your script and you're ready to go!

var Zephyros = require('node-zephyros');

var z = new Zephyros();

z.bind('t', ['Cmd', 'Shift']).clipboardContents().then(function(clipboard){
  console.log("clipboard: ", clipboard);
});

API

Starting a chain

There are three types of methods that can initiate a new chain:

bind
bind( key<String>, modifier<Array> )
Listen to a particular key combination and fire the chain every time such shortcut is triggered.

z.bind('t', ['Cmd', 'Shift']).then(function(){
  console.log('Hey, you pressed t+⌘⌃');
});

listen
listen( event<String> )
Listen to a particular event and fire the chain every time this event occurs. A comprehensive list of events is available here

z.listen('window_created').then(function(){
  console.log('Hey, you created a new window!');
});

api
api()
Manually trigger a chain.

z.api().then(function(){
  console.log('Fired immediately only once.');
});

When a new chain is initialised, you can use the API to interact with Windows, Apps, Screens or Utils.

Window

windowFocused
Return a window object with the id of the focused window.

z.bind('t', ['Cmd', 'Shift']).windowFocused().then(function(window){
  console.log(window.id);
});

windowsVisible
Return an array containing a window object for each visible window.

z.bind('t', ['Cmd', 'Shift']).windowsVisible().then(function(windows){
  window.forEach(console.log);
});

windows
Return an array containing a window object for all the windows.

z.bind('t', ['Cmd', 'Shift']).windows().then(function(windows){
  window.forEach(console.log);
});

windowTitle
Return a window object with the id of the window and the title.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.windowTitle()
.then(function(window){
  console.log(window.title);
});

getWindowFrame
Return a window object with the id of the window and the frame.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.getWindowFrame()
.then(function(window){
  console.log(window.frame); // {x: 0, y: 0, w: 200, h: 200}
});

setWindowFrame
Set the window frame for the window identified by id.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.getWindowFrame()
.setWindowFrame(function(window){
  window.frame.w /= 2;
  return window;
});

maximize
Maximize the window identified by id.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.maximize();

minimize
Minimize the window identified by id.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.minimize();

unminimize
Unminimize the window identified by id.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.unminimize();

windowFocus{up, down, right, left}
Focus the window identified by id to the {right, left, up, down}.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.windowFocusUp();

windowsTo{north, south, east, west}
Return an array of window objects for windows located on the {north, south, east, west}.

z.bind('t', ['Cmd', 'Shift'])
.windowsToNorth()
.then(function(windows){
  windows.forEach(console.log);
});

Screen

screenFromWindow
Get the screen object from the window identified by id.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.screenFromWindow()
.then(function(screen){
  console.log(screen); //{ id: 2 }
});

mainScreen
Get the main screen object.

z.bind('t', ['Cmd', 'Shift'])
.mainScreen()
.then(function(screen){
  console.log(screen); //{ id: 1 }
});

frameIncludingDockAndMenu
Get the frame including the dock and the menu for a screen identified by id.

z.bind('t', ['Cmd', 'Shift'])
.mainScreen()
.frameIncludingDockAndMenu()
.then(function(screen){
  console.log(screen.frame); //{ x: 0, y: 0, w: 100, h: 100 }
});

frameWithoutDockOrMenu
Get the frame without the dock or menu for a screen identified by id.

z.bind('t', ['Cmd', 'Shift'])
.mainScreen()
.frameWithoutDockOrMenu()
.then(function(screen){
  console.log(screen.frame); //{ x: 0, y: 0, w: 80, h: 80 }
});

screens
Return an array containing a screen object for all the screens available.

z.bind('t', ['Cmd', 'Shift'])
.screens()
.then(function(screens){
  screens.forEach(console.log);
});

App

appFromWindow
Get the app object from the window identified by id.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.appFromWindow()
.then(function(app){
  console.log(app); //{ id: 1 }
});

apps
Return an array containing an app object for all the apps running.

z.bind('t', ['Cmd', 'Shift'])
.apps()
.then(function(screens){
  screens.forEach(console.log);
});

appTitle
Return the app object with the id of the app and the title.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.appFromWindow()
.appTitle()
.then(function(app){
  console.log(app); // {id: 1, title: 'Zephyros'}
});

appIsHidden
Return the app object with the id of the app and the boolean isHidden set to false if the app is not hidden.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.appFromWindow()
.appIsHidden()
.then(function(app){
  console.log(app); // {id: 1, isHidden: false}
});

appShow
Show the app identified by id.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.appFromWindow()
.appHide()
.appShow()

appHide
Hide the app identified by id.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.appFromWindow()
.appHide()
.appShow()

appKill
Kill the app identified by id.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.appFromWindow()
.appKill()

appKill9
Kill9 the app identified by id.

z.bind('t', ['Cmd', 'Shift'])
.windowFocused()
.appFromWindow()
.appKill9()

Util

clipboardContents
Return a string with the content of the clipboard

z.bind('t', ['Cmd', 'Shift'])
.clipboardContents()
.then(function(clipboard){
  console.log(clipboard); // Zephyros
});

updateSettings
Trigger an update for Zephyros settings.

z.bind('t', ['Cmd', 'Shift']).updateSettings();

reloadConfig
Force a reload of the config file.

z.bind('t', ['Cmd', 'Shift']).reloadConfig();

alert
Prompt an alter.

z.bind('t', ['Cmd', 'Shift']).alert({message: 'Hello'});
z.bind('t', ['Cmd', 'Shift']).alert('Hello'); // as above
z.bind('t', ['Cmd', 'Shift']).alert(function(){
  return { message: 'Hello World', duration: 3 };
}); // as above

log
Log a string.

z.bind('t', ['Cmd', 'Shift']).log({message: 'Log'});
z.bind('t', ['Cmd', 'Shift']).log('Hello'); // as above
z.bind('t', ['Cmd', 'Shift']).alert(function(){
  return 'Log';
}); // as above

chooseFrom
Choose a list of items from a dinamically populated popup.

z.bind('t', ['Cmd', 'Shift']).chooseFrom({
  list: ['Banana', 'Pineapple', 'Orange'],
  title: 'Fruits',
  lines_tall: 10,
  chars_wide: 30
}).then(function(selected){
  console.log(selected); // index of the array
});

Tests

Tests are written in Mocha. Simply run the test with:

~$ mocha