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

osx-photostream

v1.1.1

Published

Process new PhotoStream photos in realtime with iCloud on OSX

Downloads

5

Readme

osx-photostream

Process new images in real-time with iCloud PhotoStream on OSX.

This node.js module can run in the background to listen (kqueue) for new images in your PhotoStream on iCloud. You can snap a photo with your iPhone and within moments have your Mac archive it to another folder or do other post-processing with it.

Requirements

  • Mac OS X (tested on 10.9 and 10.10)
  • Mac with iCloud account and PhotoStream enabled
  • Another Apple device with iCloud and PhotoStream enabled
  • node.js

Installation

The release on npm is always the latest stable version:

npm install osx-photostream

The code in the Github repository is the most recent, but can be unstable:

npm install fvdm/nodejs-osx-photostream

Usage

There are two ways to use this module, these can be combined:

Copy new images to another folder

Very useful if you prefer apps like Picasa over iPhoto. For example, to archive photos before iCloud expires them after 30 days.

var ps = require('osx-photostream')('~/Pictures/iCloud')

Do something else with new images

var ps = require('osx-photostream')()

ps.on( 'update', function( file ) {
  console.log('New image added: '+ file.filename)
})

Copy to folder and forward with iMessage to friend

var ps = require('osx-photostream')('~/Pictures/iCloud')
var exec = require('child_process').exec
 
ps.on( 'copy', function( file ) {
  // Forward image to friend with iMessage
  exec('osascript -e "tell application \"Messages\" to send POSIX file \"'+ file.copypath +'\" to buddy \"[email protected]\" of service \"E:[email protected]\""')
})

Events

update : callback( fileObject )

A new file was added to your PhotoStream.

ps.on( 'update', function( file ) {
  console.log( 'New image: '+ file.filename )
})

copy : callback ( fileObject )

A new file was copied from PhotoStream to the other folder.

This event is only triggered when a destination path is set and the copy succeeded.

ps.on( 'copy', function( file ) {
  // tell another app or module the image at file.copypath is ready.
})

watching : callback ( watchPath )

The app is watching watchPath for updates.

ps.on( 'watching', function( watchPath ) {
  console.log( 'Watching PhotoStream' )
})

fail : callback ( reason, error, [fileObject] )

An error occured. You can safely ignore this event, but it may help in times of trouble.

parameter | description ---------- | ---------------------------------------------- reason | See table below. error | The error as reported. fileObject | See below.

ps.on( 'fail', function( reason, error, file ) {
  console.log( 'ERROR: '+ reason +' - '+ file.filename )
  console.log( error )
})

reason | description -------------- | ------------------------------------ exception | Uncaught exception watch error | Something went wrong during watching readdir failed | New item can not be read mkdir failed | Can not create copy destination copy failed | Can not copy new file to destination

fileObject

property | description --------- | ------------------------------------------- .pathname | Path to your PhotoStream location .filename | Filename of the new file, i.e. IMG_5778.PNG .fullpath | .pathname +'/'+ .filename .copypath | If copied, new location with filename

Unlicense

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to http://unlicense.org

Author

Franklin van de Meent | Website | Github