New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tweet-to-html

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tweet-to-html

Browser friendly package that converts twitter's API tweet objects text property to HTML. Takes care of all the entities and its links. Handles emoji's.

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
4
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

tweet-to-html

Build Status npm version

Browser friendly package that converts twitter's API tweet objects text property to HTML. Takes care of all the entities and its links. Handles emoji's.

Demo

http://blessanm86.github.io/tweet-to-html/

Installation

npm install tweet-to-html -S
yarn add tweet-to-html

Usage

There is only one method named parse. You can pass in a tweet object or an array of objects, and an optional config object. The response will be object/array tweet object with a new property named html with the parsed output.

var tweetToHTML = require('tweet-to-html');

var result  = tweetToHTML.parse(tweetObj); //Single tweet object
var results = tweetToHTML.parse(tweetArr); //Multiple tweets in an array

var photoConfig = {
  photoSize: 'large' // Any size supported by the `media` entity (thumb, small, medium...)
};

var result  = tweetToHTML.parse(tweetObj, photoConfig); //Single tweet object with specified image size

//output
console.log(result.html);
console.log(results[0].html);

Issues Or Contributions

Keywords

twitter

FAQs

Package last updated on 15 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts