# import-folder

> Import all exported modules from files in folder at once

Latest version **0.0.6** (published 2021-12-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install import-folder
pnpm add import-folder
yarn add import-folder
bun add import-folder
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2021-12-03 |
| First published | 2021-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Luiz Felipe Zarco |
| Maintainers | zarco |
| Keywords | import, require, folder, directory, dir, index, files, all, modules, typescript, javascript |

## Links

- npm: https://www.npmjs.com/package/import-folder
- Repository: https://github.com/felipezarco/import-folder
- Homepage: https://github.com/felipezarco/import-folder#readme
- Issues: https://github.com/felipezarco/import-folder/issues
- npm.io page: https://npm.io/package/import-folder

## Dependencies (1)

- [import-folder](https://npm.io/package/import-folder.md) ^0.0.4

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.0.6 (latest) — 2021-12-03
- 0.0.5 — 2021-12-03
- 0.0.4 — 2021-12-03
- 0.0.3 — 2021-12-03
- 0.0.2 — 2021-12-02
- 0.0.1 — 2021-12-02

## README

# import-folder

> Import or require all folder modules at once

While importing or requiring many modules from a folder, one may find necessity for something such as an index that exports each single file so that modules would be imported at once. This creates maintance problems, since you have to remember to export them every time.

Works with for both *Typescript* and *Javascript* modules!

`import-folder` helps you import all exports within a folder at once


[![npm](https://nodei.co/npm/import-folder.png)](https://www.npmjs.com/package/import-folder)

![vscode suggestions](https://raw.githubusercontent.com/felipezarco/files/master/images/folder.PNG)


[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/import-folder.svg)](https://badge.fury.io/js/felipezarco%2Fimport-folder) [![Build Status](https://travis-ci.org/felipezarco/import-folder.svg?branch=master)](https://travis-ci.org/felipezarco/import-folder) [![Coverage Status](https://coveralls.io/repos/github/felipezarco/import-folder/badge.svg?branch=master)](https://coveralls.io/github/felipezarco/import-folder?branch=master) ![Downloads](https://img.shields.io/npm/dw/import-folder)

## Installation

Use your favorite package manager to install. For instance: 

```
  yarn add import-folder
```

Then import it with ES or CommonJS:

```javascript
import importFolder from 'import-folder'
```


Given an example folder `helpers` with files named `math.js` and `prompt.ts` exporting example modules: 

```javascript
const modules = importFolder('helpers')

modules.math.add(2,2)
modules.prompt('Hello World')  
```

Or directly deconstructing modules:

```javascript
const { math, prompt } = importFolder('helpers')

math.add(2,2)
prompt('Hello World')  
````

## Testing

Run the test suit with `yarn test`.

## Contributing

If you want to contribute in any of theses ways:

- Give your ideas or feedback
- Question something
- Point out a problem or issue
- Enhance the code or its documentation
- Help in any other way

You can (and should) [open an issue](https://github.com/felipezarco/import-folder/issues/new) or even a [pull request](https://github.com/felipezarco/import-folder/compare)!

Thanks for your interest in contributing to this repo!

## Author

[Luiz Felipe Zarco](https://github.com/felipezarco) (felipezarco@hotmail.com)

## License

This code is licensed under the [MIT License](https://github.com/felipezarco/import-folder/blob/master/LICENSE.md). See the [LICENSE.md](https://github.com/felipezarco/import-folder/blob/master/LICENSE.md) file for more info.

---
_Source: https://npm.io/package/import-folder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
