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

local-itunes

v0.4.0

Published

control itunes

Downloads

28

Readme

local-itunes NPM Build Status

control itunes

Install

npm i local-itunes

Usage

var iTunes = require('local-itunes');
iTunes.playerState(function(error, state){
  if (state === 'paused') iTunes.play();
});

Documents

play(callback)

Play iTunes track.

callback(error);

pause(callback)

Pause track.

callback(error);

stop(callback)

Stop iTunes.

callback(error);

playpause(callback);

Toggle play/pause.

callback(error);

previous(callback);

Go to the beginning of the song or previous song if playback is already at the beginning.

callback(error);

next(callback);

Go to next song.

callback(error);

playerState(callback)

Get current iTunes state.

callback(error, state);

state: iTunes state string (stopped,playing,paused)

currentTrack(callback);

Get current playing track informations.

callback(error, data);

data: track data object.

{ 
  id: 3226,
  container: 'Application("iTunes").sources.byId(64).userPlaylists.byId(1425)',
  class: 'fileTrack',
  index: 2,
  albumArtist: '',
  persistentID: '5BFF1A83F337DFA9',
  albumLoved: false,
  albumRatingKind: 'computed',
  artist: 'airtoxin',
  album: 'airtoxin',
  albumRating: 0,
  name: 'recently liveset 20140530',
  properties: 'class:fileTrack, id:3226, index:2, name:recently liveset 20140530, persistentID:5BFF1A83F337DFA9, databaseID:3221, dateAdded:Tue Jul 14 2015 19:11:36 GMT+0900 (JST), time:33:30, duration:2010.5140380859375, artist:airtoxin, albumArtist:, composer:, album:airtoxin, genre:, bitRate:320, sampleRate:44100, trackCount:0, trackNumber:0, discCount:0, discNumber:0, size:80677570, volumeAdjustment:0, year:2014, comment:, eq:, kind:MPEG オーディオファイル, videoKind:none, modificationDate:Tue Jul 14 2015 19:11:30 GMT+0900 (JST), enabled:true, start:0, finish:2010.5140380859375, playedCount:7, playedDate:Tue Jan 20 2015 09:24:10 GMT+0900 (JST), skippedCount:0, skippedDate:null, compilation:false, gapless:null, rating:0, bpm:0, grouping:, podcast:false, itunesu:false, bookmarkable:false, bookmark:0, shufflable:true, lyrics:, category:, description:, longDescription:null, show:, seasonNumber:0, episodeID:, episodeNumber:0, unplayed:false, sortName:, sortAlbum:, sortArtist:, sortComposer:, sortAlbumArtist:, sortShow:, releaseDate:null, loved:false, albumLoved:false',
  bitRate: 320,
  comment: '',
  bookmark: 0,
  bpm: 0,
  grouping: '',
  playedDate: Tue Jan 20 2015 09:24:10 GMT+0900 (JST),
  bookmarkable: false,
  finish: 2010.5140380859375,
  lyrics: '',
  kind: 'MPEG オーディオファイル',
  enabled: true,
  sortAlbumArtist: '',
  year: 2014,
  modificationDate: Tue Jul 14 2015 19:11:30 GMT+0900 (JST),
  dateAdded: Tue Jul 14 2015 19:11:36 GMT+0900 (JST),
  composer: '',
  longDescription: null,
  episodeNumber: 0,
  start: 0,
  rating: 0,
  trackNumber: 0,
  sortArtist: '',
  eq: '',
  loved: false,
  sortComposer: '',
  videoKind: 'none',
  category: '',
  genre: '',
  itunesu: false,
  show: '',
  podcast: false,
  releaseDate: null,
  skippedDate: null,
  discNumber: 0,
  playedCount: 7,
  skippedCount: 0,
  trackCount: 0,
  duration: 2010.5140380859375,
  sampleRate: 44100,
  compilation: false,
  episodeID: '',
  volumeAdjustment: 0,
  gapless: null,
  time: '33:30',
  discCount: 0,
  sortShow: '',
  databaseID: 3221,
  unplayed: false,
  sortName: '',
  shufflable: true,
  sortAlbum: '',
  size: 80677570,
  ratingKind: 'computed',
  seasonNumber: 0,
  description: '' 
}

currentPlaylist(callback);

Get current playing playlist informations.

data: track data object.

{ 
  container: 'Application("iTunes").sources.byId(64)',
  duration: 111226,
  id: 1425,
  index: 2,
  class: 'userPlaylist',
  persistentID: '04251A70F978A503',
  time: '1:06:53:46',
  specialKind: 'Music',
  loved: false,
  name: 'ミュージック',
  properties: 'class:userPlaylist, id:1425, index:2, name:ミュージック, persistentID:04251A70F978A503, duration:111226, size:4440656665, time:1:06:53:46, visible:true, shuffle:false, songRepeat:off, specialKind:Music, loved:false',
  visible: true,
  shuffle: false,
  songRepeat: 'off',
  size: 4440656665 
}