Skip to content

simplylunar/foremjs-old

Repository files navigation

NPM API COVERAGE npm Codacy grade GitHub issues npm bundle size code style

ForemJS

ForemJS is an API wrapper for the Forem API which empowers dev.to. This wrapper currently allows you to get articles, users, and comments, and post your own articles. Currently, the API only covers about 60% of the API, however by v1.0.0, the API will cover the entire API.

Installation

Use NPM to download ForemJS.

npm install foremjs --save

Usage

const Forem = require('foremjs')
const client = new Forem.Client(YOUR_TOKEN_HERE);

(async () => {
  const article = await client.getArticle('danielnewell/introducing-foremjs-the-api-wrapper-for-dev-to-5amo')
  console.log(article.tag) // ['node', 'forem', 'javascript', 'opensource']
  const user = await client.getUser(1)
  console.log(user.name) // Ben Halpern
})()

You can get a token on your Dev.to account settings page. This wrapper runs asynchronously, so you can use an anonymous function to run your code easily. A full documentation is being worked on.

Contributing

We are always looking for people help with this project. Create an issue and once we approve it, you can start working on it. Or you can make a suggestion and somebody else can add it for you.

License

MIT