# compile_main_file

> scans files in sub directories for js files and creates a master file that exports all files by name

Latest version **1.0.3** (published 2017-06-30) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install compile_main_file
pnpm add compile_main_file
yarn add compile_main_file
bun add compile_main_file
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2017-06-30 |
| First published | 2017-06-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | mattias lemmens |
| Maintainers | wouldbenerd |
| Keywords | compile, library, directory, scan |

## Links

- npm: https://www.npmjs.com/package/compile_main_file
- npm.io page: https://npm.io/package/compile_main_file

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2017-06-30
- 1.0.2 — 2017-06-30
- 1.0.1 — 2017-06-30
- 1.0.0 — 2017-06-30

## README

#compile_main_file
iterates all subdirectories in a directory
writes a module.exports line for each file containd in each sub directories

### example
####say you have a directory called "./lib_dir/"
`./lib_dir/`| | 
---|---|---
  |TEST1/|  
  |  |file_1.js
  |  |file_2.json
  |TEST2/|  
  |  |file_3.js
CAUTION: provided file_name variable will be overwritten in the main directory,
each file must have a unique name; an error will throw if this occurs, your compile file will be broken until you fix the error and rerun
```javascript
let compile_main_file = require(compile_main_file)
compile_main_file("./lib_dir/", "index")
```
####index.js will compiled to look like this
```javascript
module.exports.file_1=require('./lib_dir/TEST1/file_1.js') 
module.exports.file_2=require('./lib_dir/TEST1/file_2.json') 
module.exports.file_3=require('./lib_dir/TEST2/file_3.js') 
```

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