DEV Community

John Woodruff
John Woodruff

Posted on • Updated on • Originally published at johnbwoodruff.com

DigitalOcean JS 1.0 Released!

I've been writing a library, DigitalOcean JS, for the last year in my spare time. I started it because I was building a DigitalOcean mobile app using Ionic for use in managing your DigitalOcean resources from your phone. In looking at the various libraries available for my use, I disliked them for a few reasons, including use of callback functions instead of Promises, only being able to use some in Node and not the browser, among other things. Due to those issues, I decided to build my own that was structured how I would like to use it, with some key goals in mind:

  • Be able to use in a Node or Browser environment with no difference in usage.
  • Use Promises instead of callbacks so clients can make use of async/await.
  • Be built in TypeScript so consumers of the library can benefit from excellent intellisense with the TypeScript definitions.
  • Provide solid documentation including examples for usage.

To that end I started development on DigitalOcean JS. Instead of building it all out quickly I decided to build it out as I needed it for the app I was building. As is usual with my side projects, (see my previous post) it languished to the side for a while. After writing that blog post, I decided that I wouldn't let this project die. I literally had one set of endpoints left to implement.

It is with great pleasure that I finally get to announce the official v1.0 release of DigitalOcean JS. Check it out at the repo below, and keep fighting to keep your side projects alive!

GitHub logo johnbwoodruff / digitalocean-js

JavaScript library for the DigitalOcean API

digitalocean-js

DigitalOcean JS

CI npm npm npm

JavaScript library for the DigitalOcean API. For use in Node or the browser.

Goals

This library was built with a few goals in mind:

  • Be able to use in a Node or Browser environment with no difference in usage.
  • Use Promises instead of callbacks so clients can make use of async/await.
  • Be built in TypeScript so consumers of the library can benefit from excellent intellisense with the TypeScript definitions.
  • Provide solid documentation including examples for usage.

Usage

To use the library, install from the npm repository.

$ npm install --save digitalocean-js
# Alternatively install with yarn
$ yarn add digitalocean-js
Enter fullscreen mode Exit fullscreen mode

Simply import the client and initialize it with your API token:

import { DigitalOcean } from 'digitalocean-js';

const client = new DigitalOcean('my-api-token');
Enter fullscreen mode Exit fullscreen mode

To see all the services available, check out the documentation.




Discussion (10)

Collapse
umbra2707 profile image
umbra2707

Great job!

Collapse
ben profile image
Ben Halpern

Woohoo, congrats!

Collapse
johnbwoodruff profile image
John Woodruff Author

Thanks! :) Thrilled I finally "finished" it. (of course I've already thought of stuff I should implement now... it's never ending haha)

Collapse
alejomj profile image
alejomj

Nice!

Collapse
jarland profile image
Jarland Donnell

This is really cool! Bookmarked for that perfect project or conversation :)

<3 from your friends at DigitalOcean

Collapse
johnbwoodruff profile image
John Woodruff Author

Thanks! :) Keep doing all the awesomeness you guys do best!!

Collapse
qm3ster profile image
Mihail Malo • Edited on

digitalocean-ts πŸ˜«πŸ‘Œ

Collapse
johnbwoodruff profile image
John Woodruff Author

Yeah, I made a call on what would come up easier in a search for DigitalOcean JavaScript libraries. :) Thankfully all the TypeScript benefits still come with it despite the js in the name. ;)

Collapse
sethusenthil profile image
Sethu Senthil

Is this official?

Collapse
johnbwoodruff profile image
John Woodruff Author

Not an official DigitalOcean library, just a community library I wrote to contribute to anyone who wants to use it. :)