ini as well as
While reading the Node.js API documentation today, I stumbled upon an interesting feature. This feature let’s you add handlers for arbitrary file extensions that
require() will call when requiring a file of that extension. Internally, it looks for the extension in
require.extensions and if the extension is found, the handler is called instead of the default require routine.
I thought that was pretty cool so I couldn’t resist the urge of wrapping a bunch of file parsers into a standalone NPM module that would make it easy to support for multiple file formats through
This gave birth to better-require.
npm install better-require
If allows developers to seamlessly require
ini files without having to deal with
require.extensions or finding the appropriate parsing libraries. It is also easily extensible so feel free to fork and add additional file formats!
Here’s a usage example:
1 2 3 4 5 6 7 8 9 10 11