This is a `playground`

to test code. It runs a full `Node.js`

environment and already has all of `npm`

’s 400,000 packages pre-installed, including `pertestimate`

with all `npm`

packages installed. **Try it out**:

var pertestimate = require("pertestimate")

- all documents on RunKit are public
`require()`

any package directly from npm- use arrow functions, classes, template strings, and most of ES6
`await`

any promise instead of using callbacks (example)- create your own embedded
**node.js**snippets

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

The PERT technique of task estimation is a trivariate estimate taking into account the best and worst possible scenarios to give a weighted average. It is also possible to calculate the standard deviation, which represents the level of confidence in the estimate.

`npm install --save pertestimate`

`pertestimate(guesstimates [, callback(results)]);`

The first argument is an object with your best 'guesstimates'.

```
{
best: 3, // [Number]: The best possible outcome you can imagine, given nothing goes wrong.
guess: 10, // [Number]: Your initial estimate, given based on your experience.
worst: 20 // [Number]: The worst possible outcome, given everything goes wrong.
}
```

The second argument is an optional callback function which receives an object containing the calculated estimate and standard deviation.

```
const pertestimate = require('pertestimate');
const guesstimates = {
best: 3,
guess: 10,
worst: 20
}
pertestimate(guesstimates);
// --> {estimate: 10.5, deviation: -2.8333333333333335}
pertestimate(guesstimates, res => `Around ${res.estimate}, with a standard deviation of ${res.deviation}. So, most likely somewhere between ${Math.ceil(res.estimate + res.deviation)} and ${Math.ceil(res.estimate - res.deviation)}.`);
// --> "Around 10.5, with a standard deviation of -2.8333333333333335. So, most likely somewhere between 8 and 14."
```

- package on npmhttps://npmjs.com/package/pertestimate
- homepagehttps://github.com/jacobwarduk/pertestimate#readme
- licenseMIT

RunKit is a free, in-browser JavaScript dev environment for prototyping **Node.js** code, with every **npm** package installed. Sign up to share your code.

Sign Up for Free