Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

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

twilio-labs/create-twilio-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

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]
  -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 git@github.com: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