# vz.stepper

> Asynchronous workflow helper

Latest version **1.1.5** (published 2014-10-06) · LGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install vz.stepper
pnpm add vz.stepper
yarn add vz.stepper
bun add vz.stepper
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2014-10-06 |
| First published | 2014-09-01 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Manuel Valls Fernández |
| Maintainers | manvalls |

## Links

- npm: https://www.npmjs.com/package/vz.stepper
- Repository: https://github.com/manvalls/vz.stepper
- Issues: https://github.com/manvalls/vz.stepper/issues
- npm.io page: https://npm.io/package/vz.stepper

## Dependencies (2)

- [vz.property](https://npm.io/package/vz.property.md)
- [vz.constants](https://npm.io/package/vz.constants.md)

## Recent versions

- 1.1.5 (latest) — 2014-10-06
- 1.1.4 — 2014-09-09
- 1.1.3 — 2014-09-09
- 1.1.2 — 2014-09-06
- 1.1.1 — 2014-09-02
- 1.1.0 — 2014-09-02
- 1.0.3 — 2014-09-02
- 1.0.2 — 2014-09-01
- 1.0.1 — 2014-09-01
- 1.0.0 — 2014-09-01

## README

# vz Stepper

**DEPRECATED in favour of [vz.walk](https://www.npmjs.org/package/vz.walk "vz.walk")**

[![NPM](https://nodei.co/npm/vz.stepper.png?downloads=true)](https://nodei.co/npm/vz.stepper/)

No piece of software is ever completed, feel free to contribute and be humble

## Sample usage:

```javascript

var Stepper = require('vz.stepper'),
    fs = require('fs'),
    fileName = 'foo.bar';

// Lower case file

(new Stepper(function(args,vars){
  
  switch(this.step){
    case 'start':
      vars.name = args[0];
      fs.exists(this.name,this.goTo('checkFile',vars));
      break;
    case 'checkFile':
      if(args[0]) fs.readFile(vars.name,{
        encoding: 'utf8'
      },this.goTo('open',vars));
      else throw 'File doesn\'t exist';
      break;
    case 'open':
      if(args[0]) throw args[0];
      args[1] = args[1].toLowerCase();
      fs.writeFile(vars.name,args[1],this.goTo('end'));
      break;
    case 'end':
      if(args[0]) throw args[0];
      console.log('Success');
      break;
  }
  
})).goTo('start')(fileName);

```

## Reference:

### Stepper object

#### Constructor([callback])

Creates and initializes a stepper with *callback* as its internal callback.

#### Stepper.step

The current step of the stepper

#### Stepper.goTo(step[,callback][,vars])

Returns a function which executes *callback* or the internal callback of the stepper, with the stepper as the thisArg, seting the current step to *step* and passing as the first argument the supplied arguments to the function, and as the second *vars* or an empty object.

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