danthareja / node-google-apps-script

[DEPRECATED - use clasp instead] The easiest way to develop Google Apps Script projects
MIT License
353 stars 70 forks source link

API for gapps (using it programmatically) #44

Open gunar opened 7 years ago

gunar commented 7 years ago

Is there a way to use gapps as a JS-library instead of using the CLI? Thank you!

gunar commented 7 years ago

I think there's a way to since index.js exports the commands. Perhaps only docs are missing?

module.exports.auth = require('./lib/commands/auth');
module.exports.init = require('./lib/commands/init');
module.exports.upload = require('./lib/commands/upload');
module.exports.defaults = require('./lib/defaults');

I'm investigating further...

gunar commented 7 years ago

So it works but it's a bummer that the commands themselves do console.logs, instead of just propagating errors.

shrugs commented 7 years ago

Hmm, good catch, that's a poor design decision. I think a PR propagating the errors to the top level would be really valuable.