question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Programmatic API ?

See original GitHub issue

To integrate claudia into a project (which already has some tasks like Babel for processing files) it would be useful to access the different functions of the CLI tool directly in node. What do you think about exporting the different calls from the module instead of just the shell runtime ?

import { create as createLambda } from 'claudia'

createLambda(/** params **/).then(() => { .... })

Since these setup helpers contain the actual logic for working with AWS lambda & API gateway, the commandline interface could either be a different repository or check the process for its callee.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
gojkocommented, Mar 1, 2016

that’s already there, just not fully documented. each command of the CLI is also exported as a method, so you can, for example, do:

var claudia = require('claudia');
claudia.create({name: 'lambda-function', version: 'development', 'api-module': 'web-api', region: 'us-east-1'})

all methods return promises.

instead of dashes, the methods are camel-cased (so test-lambda CLI corresponds to testLambda in Javascript); the options are the same, just without double-dashes, so instead of --name, the use name.

this is stable and 100% supported, my plan is to use it for grunt/gulp integration in the future, so you can rely on that API. I will document it soon.

0reactions
JordanPrinceTcommented, Sep 7, 2017

@gojko It works! CamelCase only for method and not for options, my error! Thanks a lot 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Programmatic API - Picocli
The programmatic API allows applications to dynamically create command line options on the fly, and also makes it possible to create idiomatic ...
Read more >
Programmatic | Ad Manager API - Google Developers
This guide is a high-level overview of how to use Programmatic Direct features via the API. It describes how to create a Proposal...
Read more >
Programmatic APIs - Oracle Help Center
The Berkeley DB subsystems can be accessed through interfaces from multiple languages. Applications can use Berkeley DB via C, C++ or Java, ...
Read more >
Programmatic APIs - IBM
A set of supported Java APIs are available to customize elements of ContentBox. Note: Only Dashboard Application Services Hub APIs from the com.ibm.isc.api....
Read more >
Livy Docs - Programmatic API - Apache Livy
Livy provides a programmatic Java/Scala and Python API that allows applications to run code inside Spark without having to maintain a local Spark...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found