Convert Tweets to Markdown embeds.
npm install --save md-tweet-embed
# or
yarn add md-tweet-embed
From a JavaScript file, run through Node.js
import { mdTweetEmbed } from 'md-tweet-embed';
mdTweetEmbed(['https://twitter.com/hugo__df/status/1314635351928041472'])
.then(([markdownEmbed]) => {
console.log(markdownEmbed);
// > md-tweet-embed: an npm module/CLI that takes tweet URLs and turns them to markdown
// >
// > CLI: npx md-tweet-embed <your-twitter-urls>
// >
// > From JS:
// >
// > const {mdTweetEmbed} = require('md-tweet-embed');
// > mdTweetEmbed(['twitter-url']).then(([embed]) => {}); [pic.twitter.com/2A7hCismd1](https://t.co/2A7hCismd1)
// >
// > — Hugo (@hugo\_\_df) [October 9, 2020](https://twitter.com/hugo__df/status/1314635351928041472?ref_src=twsrc%5Etfw)
});
As a CLI:
npx md-tweet-embed https://twitter.com/hugo__df/status/1314635351928041472
> md-tweet-embed: an npm module/CLI that takes tweet URLs and turns them to markdown
>
> CLI: npx md-tweet-embed <your-twitter-urls>
>
> From JS:
>
> const {mdTweetEmbed} = require('md-tweet-embed');
> mdTweetEmbed(['twitter-url']).then(([embed]) => {}); [pic.twitter.com/2A7hCismd1](https://t.co/2A7hCismd1)
>
> — Hugo (@hugo\_\_df) [October 9, 2020](https://twitter.com/hugo__df/status/1314635351928041472?ref_src=twsrc%5Etfw)
- Node 18
- npm v8
- Clone the repository
- Run
npm install
installs all required dependencies.
Equivalent
npm run <script>
should also work
npm run test
will run all tests (written with uvu).npm run fmt
will run lint with--fix
option on all the examples files (and tests).
Code is licensed under the MIT License.