# workman

> A simple command handler

Latest version **0.0.1** (published 2014-08-06) · 0 weekly downloads

## Install

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

## 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.0.1 |
| Published | 2014-08-06 |
| First published | 2014-08-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ivan Maksymenko ivanmaximenko@gmail.com |
| Maintainers | ivan_maksymenko |
| Keywords | command, hook, action, invoker, aop, decoupled |

## Links

- npm: https://www.npmjs.com/package/workman
- Repository: https://github.com/abdula/workman
- Issues: https://github.com/abdula/workman/issues
- npm.io page: https://npm.io/package/workman

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2014-08-06

## README

workman
============

## Installation
    npm install workman 
    
## Example
```javascript
var workman = require('workman'),
    fs = require('fs');

workman.define('fs.readFile', function(file, cb) {
    fs.readFile(file, 'utf8', cb);
});

workman.before('fs.readFile', function(file, cb) {
    fs.exists(file, function(exists) {
        if (!exists) {
            return cb(new Error('File does not exist'));
        }
        cb(null, file);
    });
});

workman.after('fs.readFile', function(content, cb) {
    console.log('After', content);
    cb(null, content);
});

workman.ns('fs').wrap('readFile', (function() {
    var cache = {};
    return function(file, fn, cb) {
        if (cache.hasOwnProperty(file)) {
            return cb(null, cache[file]);
        }
        fn(file, function(err, content) {
            if (err) return cb(err);
            cache[file] = content;
            return cb(null, content);
        });
    };
}()));

workman.ns('fs').do('readFile', __dirname + '/README.md', function(err, content) {
    console.log(content);
}); //or invoke
```

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