ballboy

1.1.0 • Public • Published

Ballboy

Simple file loader.

You don't need define protocol of loadable file – just say where file located and Ballboy give it to you.

Supported protocols: HTTP, HTTPS, File path, file://.

Example:

const ballboy = require('ballboy');
const executeConfig = config => console.log(JSON.parse(config));
 
ballboy('./path/to/config.json').then(executeConfig);
ballboy('http://config.io/config.json').then(executeConfig);
ballboy('https://config.io/config.json').then(executeConfig);

You can pass http config for authentication, headers e.t.c.

ballboy.HTTPConfig = {
  headers: {
    'Authentication': 'Bearer token',
    'X-Custom-Header': 'foo'
  }
}

Package Sidebar

Install

npm i ballboy

Weekly Downloads

2

Version

1.1.0

License

ISC

Unpacked Size

165 kB

Total Files

14

Last publish

Collaborators

  • mrfranke