DEV Community

Nick Polyderopoulos
Nick Polyderopoulos

Posted on

How to start planning and build a library ?

Hello.
What would your advices be concerning the architecture, planning
and crafting a new library - sdk for public use?

Top comments (3)

Collapse
 
sergiodxa profile image
Sergio Daniel Xalambrí • Edited

I like to start with the README (README driven development), define the API of the library I'm going to build and how Is going to be used (basically document it), then I just code it to follow that API.

E.g. I'm going to create a JS module to sum N amount of numbers, so I create a README and define it's going to be used this way:

import sum from 'cool-sum';
const result = sum(1, 2, 3, 4, 5, ...N);

Then I code it so it works as expected.

Collapse
 
codemouse92 profile image
Jason C. McDonald

Actually, I discussed this with one of my developers in a podcast a few months back: MousePaw'dCast Ep 2: Accents and APIs (skip to 14:50, which is the start of that part).

One takeaway (of many from that conversation): please document the API! (Also see Your Project Isn't Done Yet.)

Collapse
 
nickpolyder profile image
Nick Polyderopoulos

Thank you for your response. I will checkout those links as soon as possible :)