Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpwilliams/microload
Load a relative path and create an object from it.
https://github.com/jpwilliams/microload
Last synced: 22 days ago
JSON representation
Load a relative path and create an object from it.
- Host: GitHub
- URL: https://github.com/jpwilliams/microload
- Owner: jpwilliams
- License: mit
- Created: 2018-01-22T21:33:35.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-06-01T10:49:10.000Z (over 2 years ago)
- Last Synced: 2024-09-19T05:49:05.185Z (about 2 months ago)
- Language: JavaScript
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# microload
A simplified version of [`microboot`](https://github.com/jpwilliams/microboot) and [`microloader`](https://github.com/jpwilliams/microloader) that synchronously loads a given path as an object.
# Key features
- Requires and imports entire directories
- Ignores hidden files# Usage
``` sh
yarn add microload
`````` js
const { microload } = require('microload')
const lib = microload('./lib')
```Based on the following tree structure, `lib` would now be:
```
.
└── lib
├── config
│ ├── creds.js
│ └── tokens.json
├── getter.js
├── parser.js
└── utils
├── loadMongo.js
├── loadRedis.js
└── .loadRethink.js
`````` json
{
"config": {
"creds": ...,
"tokens": ...
},
"getter": ...,
"parser": ...,
"utils": {
"loadMongo": ...,
"loadRedis": ...
}
}
```