# act-on-modules

> Library to perform an action on all user-defined modules under a given directory

Latest version **0.1.0** (published 2016-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install act-on-modules
pnpm add act-on-modules
yarn add act-on-modules
bun add act-on-modules
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2016-06-01 |
| First published | 2016-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Eric Vallee |
| Maintainers | magnitus |

## Links

- npm: https://www.npmjs.com/package/act-on-modules
- Repository: https://github.com/Magnitus-/ActOnModules
- Homepage: https://github.com/Magnitus-/ActOnModules#readme
- Issues: http://github.com/Magnitus-/ActOnModules/issues
- npm.io page: https://npm.io/package/act-on-modules

## Dependencies (1)

- [bluebird](https://npm.io/package/bluebird.md) 3.x

## Recent versions

- 0.1.0 (latest) — 2016-06-01

## README

#Purpose

This project is provides a utility that iterates recursively in a given directory, skips over node_module directories and stops iterating recursively in any directory containing a package.json file to execute a user-defined action with the directory as an argument.

#Usage

##Sync

```
const actOnModules = require('act-on-modules');

actOnModules.sync('SomePathToADirectory', (directory) => {
    //put your logic here
});
```

##Async with callback

```
const actOnModules = require('act-on-modules');

actOnModules('SomePathToADirectory', 
(directory) => {
    //put your logic here
},
(err) => {
    //This is the callback once everything is done
    //Be mindful that asynchronous operations in your custom action might not have completed
    //You'll have to add an additional layer of logic with nimble/async or promises if you want asynchronous flow control
});
```

##Async with promise

```
const actOnModules = require('act-on-modules');

actOnModules('SomePathToADirectory', 
(directory) => {
    //put your logic here
}).then(() => {
    //This is the callback once everything is done without any error
    //Be mindful that asynchronous operations in your custom action might not have completed
    //You'll have to add an additional layer of logic with nimble/async or promises if you want asynchronous flow control
}).catch((err) => {
    //This is the callback if an error was encountered
    //Again, be mindful that asynchronous operations in your custom action might not have completed
    //You'll have to add an additional layer of logic with nimble/async or promises if you want asynchronous flow control
};
```

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