Skip to content

Instantly share code, notes, and snippets.

@thisandagain
Last active December 31, 2015 17:46
Show Gist options
  • Save thisandagain/ff1e92d1e774f71e5d9d to your computer and use it in GitHub Desktop.
Save thisandagain/ff1e92d1e774f71e5d9d to your computer and use it in GitHub Desktop.
Scratch Project - JS Client API

Setup

var client = require('scratch-project-client')({
    username: 'foo',
    password: 'bar'
});

Getting a Project

client.getProject('[someProjectId]', function (err, project) {
    // do something
});

Writing a Project

var blob = { ... };
client.setProject(blob, function (err, body) {
    // do something
});
@thisandagain
Copy link
Author

Alternative for the setup ... more a matter of taste than anything.

var ScratchProjectClient = require('scratch-project-client');
var client = new ScratchProjectClient({
    username: 'foo',
    password: 'bar'
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment