Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabrielrufino/folquire
📁 Requires all the modules from a folder
https://github.com/gabrielrufino/folquire
helper modules nodejs npm package
Last synced: 7 days ago
JSON representation
📁 Requires all the modules from a folder
- Host: GitHub
- URL: https://github.com/gabrielrufino/folquire
- Owner: gabrielrufino
- License: mit
- Created: 2021-04-23T01:06:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T01:09:02.000Z (18 days ago)
- Last Synced: 2024-10-30T13:51:17.706Z (16 days ago)
- Topics: helper, modules, nodejs, npm, package
- Language: JavaScript
- Homepage: https://folquire.gabrielrufino.com
- Size: 1.16 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Folquire banner](./assets/folquire.png)
# Folquire
Requires all the modules from a folder
### Getting started
To install run this command:
```bash
$ npm install folquire
```Let's see an example. Suppose we have the following folder structure:
```
+-- math
| +-- add.js
| +-- subtract.js
| +-- multiply.js
| +-- divide.js
+-- index.js
```index.js
```js
'use strict'const { join } = require('path')
const folquire = require('folquire')const math = folquire(join(__dirname, 'math'))
math.add(1, 2) // 2
math.subtract(8, 4) // 4
math.multiply(6, 7) // 42
math.divide(20, 10) // 2
```### Async folquire
index.js
```js
'use strict'const { join } = require('path')
const folquire = require('folquire')folquire(join(__dirname, 'math'))
.then(math => {
math.add(1, 2) // 2
math.subtract(8, 4) // 4
math.multiply(6, 7) // 42
math.divide(20, 10) // 2
})
```### Ignore modules
```js
'use strict'const { join } = require('path')
const folquire = require('folquire')const modules = folquire(join(__dirname, 'math'), {
ignore: ['add.js']
})
```---
Black Tech by [Gabriel Rufino](https://github.com/gabrielrufino) 🖤