Skip to content

Instantly share code, notes, and snippets.

@bdryanovski
Created March 21, 2012 21:02
Show Gist options
  • Select an option

  • Save bdryanovski/2152807 to your computer and use it in GitHub Desktop.

Select an option

Save bdryanovski/2152807 to your computer and use it in GitHub Desktop.
Plaing with id3 and coffeescript.
id3 = require('id3')
walk = require('walk')
fs = require('fs')
files = []
directory = '/media/8A02D1CD02D1BE7F/Music'
walker = walk.walk(directory, { followLinks: false})
walker.on('file', (root,stat,next) ->
files.push(root + '/' + stat.name)
next()
)
walker.on('end', () ->
for file in files
rfile = fs.readFileSync(file);
fileInfo = new id3(rfile)
console.log '---------------------------------------------------------'
console.log(fileInfo.getTags())
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment