A general purpose Photoshop file parser.
A general purpose PSD parser written in Coffeescript. Based off of PSD.rb.
Runs in both NodeJS and the browser (using browserify). There are still some pieces missing that are present in PSD.rb, such as layer comp filtering, layer image exporting, a built-in renderer, and many layer info blocks. The eventual goal is full feature parity with PSD.rb.
PSD.js has no native dependencies. Simply add
psd to your package.json or run
npm install psd.
PSD.js works almost exactly the same in the browser and NodeJS.
var PSD = require'psd';var psd = PSDfromFile"path/to/file.psd";psdparse;console.logpsdtreeexport;console.logpsdtreechildrenAtPath'A/B/C'0export;// You can also use promises syntax for opening and parsingPSDopen"path/to/file.psd"thenreturn psdimagesaveAsPng'./output.png';thenconsole.log"Finished!";;
var PSD = require'psd';// Load from URLPSDfromURL"/path/to/file.psd"thendocumentgetElementById'ImageContainer'appendChildpsdimagetoPng;;// Load from event, e.g. drag & dropPSDfromEventevtthenconsole.logpsdtreeexport;;