A command line tool to setup a new Twilio Function with local testing using twilio-run
.
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.
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
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)]
Any help contributing to this project is welcomed. Make sure you read and agree with the code of conduct.
- Fork the project
- Clone the fork like so:
git clone git@github.com:YOUR_USERNAME/create-twilio-function.git
- Install the dependencies
cd create-twilio-function
npm install
- Make your changes
- Test your changes with
npm test
- Commit your changes and open a pull request
MIT