Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update you readme ffs. #990

Closed
4 tasks done
ralyodio opened this issue Jan 3, 2024 · 4 comments
Closed
4 tasks done

update you readme ffs. #990

ralyodio opened this issue Jan 3, 2024 · 4 comments
Labels
status: waiting for feedback waiting for feedback from the submitter

Comments

@ralyodio
Copy link

ralyodio commented Jan 3, 2024

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.
  • This is not a general Twilio feature request or bug report. It is a feature request for the twilio-node JavaScript package.

Problem Description

give me an example with esm 2022 modules

Proposed Solution

give me an example with esm 2022 modules

Alternatives Considered

give me an example with esm 2022 modules

Additional Information

give me an example with esm 2022 modules

@ralyodio ralyodio added the type: community enhancement feature request not on Twilio's roadmap label Jan 3, 2024
@Spacey4K
Copy link

Here's an example on how to import with esm modules.

import Twilio from "twilio";
const client = Twilio(accountSid, authToken);

@celesteking
Copy link

Twilio doesn't give a shit. It's no longer a dev first platform.

@tiwarishubham635
Copy link
Contributor

Hi folks! Here is an example to use twilio with es module.

import twilio from 'twilio'

const accountSid = 'xxx'
const authToken = 'xxx'
const client = twilio(accountSid, authToken)

client.messages
  .create({
      body: 'Hello from Twilio',
      from: '+1xxx',
      to: '+1xxx'
  })
  .then(message => {
    console.log(message.sid)
  })

Make sure you have "type": "module" present in your package.json. Thanks!

@tiwarishubham635 tiwarishubham635 added status: waiting for feedback waiting for feedback from the submitter and removed type: community enhancement feature request not on Twilio's roadmap labels Apr 5, 2024
@tiwarishubham635
Copy link
Contributor

Closing this issue as no update was received in last 30 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for feedback waiting for feedback from the submitter
Projects
None yet
Development

No branches or pull requests

4 participants