Commit 667a6019 authored by Ryan LeFevre's avatar Ryan LeFevre

Update README

parent e6b4e828
......@@ -6,9 +6,11 @@ A general purpose PSD parser written in Coffeescript. Based off of [PSD.rb](http
Runs in both NodeJS and the browser (using browserify).
**Work in Progress**
## Basic Usage
## Usage
PSD.js works almost exactly the same in the browser and NodeJS.
### NodeJS
``` js
var PSD = require('psd');
......@@ -17,3 +19,21 @@ psd.parse();
console.log(psd.header.export());
```
### Browser
``` js
var PSD = require('psd');
// Load from URL
PSD.fromURL("/path/to/file.psd").then(function(psd) {
document.getElementById('ImageContainer').appendChild(psd.image.toPng());
});
// Load from event, e.g. drag & drop
function onDrop(evt) {
PSD.fromEvent(evt).then(function (psd) {
console.log(psd.tree().export());
});
}
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment