import * as Twilio from 'twilio';
const YOUR_AUTH_TOKEN = process.env.TWILIO_AUTH_TOKEN;
const YOUR_ACCOUNT_SID = process.env.TWILIO_ACCOUNT_SID;
const client = Twilio(YOUR_ACCOUNT_SID, YOUR_AUTH_TOKEN);
client.messages
.create({
body: 'This is the ship that made the Kessel Run in fourteen parsecs?',
from: '+15017122661',
to: '+15558675310'
})
.then(message => console.log(message.sid));
2条答案
按热度按时间xmjla07d1#
在库中(您可以看到here):
module.exports = Car
将等效于export default Car
因此,您可以使用以下命令导入模块:
v8wbuo2f2#
您可以执行以下操作:
确保正确安装
twilio
。