Skip to content

Commit

Permalink
Added ES6 Example
Browse files Browse the repository at this point in the history
  • Loading branch information
framerate committed Nov 7, 2016
1 parent 9188932 commit ada9589
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ A utility for building [twitter intents](https://dev.twitter.com/web/intents)
Example
-------------------------------------------------------------------------------

ES5
```js
var twitterIntent = require('twitter-intent');
var href = twitterIntent.tweet.url({
Expand All @@ -20,6 +21,18 @@ var href = twitterIntent.tweet.url({
console.log('<a href="' + href + '">Click me!</a>');
```

ES6
```js
import twitterIntent from 'twitter-intent';

const href = twitterIntent.tweet.url({
text: 'Tweet me!',
hashtags: ['node.js', 'npm']
});

console.log('<a href="' + href + '">Click me!</a>');
```

Installation
-------------------------------------------------------------------------------

Expand Down

0 comments on commit ada9589

Please sign in to comment.