# walkr

> Recursive file walking / copying for node with middleware

Latest version **0.0.3** (published 2012-03-05) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2012-03-05 |
| First published | 2012-02-25 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+15 in 3 direct dependencies) |
| Install scripts | no |
| Author | Craig Condon |
| Maintainers | architectd |
| Keywords | copy |

## Links

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

## Dependencies (6)

- [ejs](https://npm.io/package/ejs.md) 0.6.x
- [step](https://npm.io/package/step.md) 0.0.x
- [outcome](https://npm.io/package/outcome.md) 0.0.x
- [structr](https://npm.io/package/structr.md) 0.1.x
- [mustache](https://npm.io/package/mustache.md) 0.4.x
- [handlebars](https://npm.io/package/handlebars.md) 1.0.x

## Recent versions

- 0.0.3 (latest) — 2012-03-05
- 0.0.2 — 2012-02-29
- 0.0.1 — 2012-02-25

## README

## Recursive file walking / copying for node.js with middleware

## Motivation

- Ability to filter files & directories.
- Inspired by [dryice](/mozilla/dryice), [findit](/substack/node-findit).


Copyr Example:

```javascript
var walkFiles = require('walkr'),
fs            = require('fs'),
mu            = require('mu'),
tplData       = {};

walkFiles(source, destination).
filter(/^\./). //no hidden files AND dirs
filterDir(/node_modules/). //no node_modules dir
filterFile(function(options, next) {
	

	//template file? parse it, and copy it.
	if(options.source.match(/.tpl.html/)) {
		
		//after write file, call next. SINCE parameters are given, walkr assumes files were written, so it does
		//not continue.
		var tpl = mu.to_html(fs.readFileSync(options.source, "utf8"), tplData);
		return fs.writeFile(options.destination, tpl, next);

	}

	//call next without parameters 
	return next();
}).
filter(walkFiles.copy).
start(function(err) {
	
	//done
});
```


Walkr Example:

```javascript
var walkFiles = require('walkr');

walkFiles(source).
on('directory', function(ops) {
	console.log(ops.source);
}).
on('file', function(ops) {
	console.log(ops.source);
}).
start(function(err) {
	
});
```

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