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.
Use NPM to download ForemJS.
npm install foremjs --save
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.
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.