Skip to content

A CLI tool to generate a new Twilio Functions project that can be run locally with twilio-run.

License

Notifications You must be signed in to change notification settings

whitneyrosenberg/create-twilio-function

 
 

Repository files navigation

create-twilio-function

A command line tool to setup a new Twilio Function with local testing using twilio-run.

Build Status Maintainability

Usage

There are a number of ways to use this tool. The quickest and easiest is with npm init:

npm init twilio-function function-name
cd function-name
npm start

This will create a new directory named "function-name" and include all the files you need to write and run a Twilio Function locally. Starting the application will host the example function at localhost:3000/example.

Alternatives

You can also use npx to run create-twilio-function:

npx create-twilio-function function-name

Or you can install the module globally:

npm install create-twilio-function -g
create-twilio-function function-name

Command line arguments

create-twilio-function <name>

Creates a new Twilio Function project

Commands:
  create-twilio-function <name>          Creates a new Twilio Function
                                         project                    [default]
  create-twilio-function list-templates  List the available templates you can
                                         create a project with.

Positionals:
  name  Name of your project.                                        [string]

Options:
  --account-sid, -a     The Account SID for your Twilio account      [string]
  --auth-token, -t      Your Twilio account Auth Token               [string]
  --skip-credentials    Don't ask for Twilio account credentials or import
                        them from the environment  [boolean] [default: false]
  --import-credentials  Import credentials from the environment variables
                        TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN
                                                   [boolean] [default: false]
  --template            Initialize your new project with a template from
                        github.com/twilio-labs/function-templates    [string]
  -h, --help            Show help                                   [boolean]
  -v, --version         Show version number                         [boolean]
  --path                                                     [default: (cwd)]

Contributing

Any help contributing to this project is welcomed. Make sure you read and agree with the code of conduct.

  1. Fork the project
  2. Clone the fork like so:
git clone [email protected]:YOUR_USERNAME/create-twilio-function.git
  1. Install the dependencies
cd create-twilio-function
npm install
  1. Make your changes
  2. Test your changes with
npm test
  1. Commit your changes and open a pull request

LICENSE

MIT

About

A CLI tool to generate a new Twilio Functions project that can be run locally with twilio-run.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 91.4%
  • HTML 6.3%
  • CSS 2.3%