Resources for Creating a Library

This is a pretty open ended question so feel free to take it in different directions. I have been learning elixir over the past few months and really enjoying myself. I wanted to take a shot at my first library and while I know technically how to create a mix project and have read through what not to do (https://hexdocs.pm/elixir/library-guidelines.html) but I am left wondering if there are other resources/blog post that give tips on best practices, how to organize, etc. Even stellar examples of well organized small/medium sized libraries that I can read through to get a sense of best practices would be quite useful (there are SO many libraries I have come across and its hard to pick out best practices from them).

2 Likes

I would think that Dashbit’s libraries are pretty good examples of how to go about things, for example: https://github.com/dashbitco/broadway

Note the guides and the docs function in mix.exs - useful docs are one of the most important aspects of a library (assuming it actually works and has a sensible API :grin:). Also note the inline docs in the code and typespecs for any public functions in the library.