Skip to content

Example does not work... what is twttr? #375

@LAMike310

Description

@LAMike310

Describe the bug
Example code in the README doesn't work

To Reproduce
Steps to reproduce the behavior:

  1. npm install twitter-text, import twitter from 'twitter-text', twttr.txt.parseTweet(tweet);, run the script
  2. ReferenceError: twttr is not defined

Expected behavior
Example code should work to parse tweet

The fix for this is to write:

var twitter = require('twitter-text');
var tweet = "This is a test tweet";
console.log(twitter.parseTweet(tweet));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions