Skip to content

Commit

Permalink
docs: add require statements
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabh3112 committed Dec 18, 2018
1 parent 3920314 commit dc57d1c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/webpack-scaffold/README.md
Expand Up @@ -2,7 +2,7 @@

This is the utility suite for creating a webpack `scaffold`. It contains utility functions to assist with inquirer prompting and scaffolding.
# Installation

<!-- TODO: To be added as part of issue #712 -->
# API

1. [parseValue()](#parsevalue)
Expand Down Expand Up @@ -121,6 +121,7 @@ Param: `name<String>, message<String>, choices<Array>`

Creates a List from Inquirer
```js
const List = require('@webpack-cli/webpack-scaffold').List;
List('entry', 'what kind of entry do you want?', ['Array', 'Function'])
```

Expand All @@ -130,6 +131,7 @@ Param: `name<String>, message<String>, choices<Array>`

Creates a RawList from Inquirer
```js
const RawList = require('@webpack-cli/webpack-scaffold').RawList;
RawList('entry', 'what kind of entry do you want?', ['Array', 'Function'])
```

Expand All @@ -139,6 +141,7 @@ Param: `name<String>, message<String>, choices<Array>`

Creates a CheckList(`checkbox`) from Inquirer
```js
const CheckList = require('@webpack-cli/webpack-scaffold').CheckList;
CheckList('entry', 'what kind of entry do you want?', ['Array', 'Function'])
```

Expand All @@ -148,6 +151,7 @@ Param: `name<String>, message<String>`

Creates an Input from Inquirer
```js
const Input = require('@webpack-cli/webpack-scaffold').Input;
Input('entry', 'what is your entry point?')
```

Expand All @@ -157,6 +161,7 @@ Param: `name<String>, message<String>, validate<Function>`

Creates an Input from Inquirer
```js
const Input = require('@webpack-cli/webpack-scaffold').Input;
const validation = (value) => {
if(value.length > 4) {
return true;
Expand All @@ -173,5 +178,6 @@ Param: `name<String>, message<String>`

Creates an Input from Inquirer
```js
const Confirm = require('@webpack-cli/webpack-scaffold').Confirm;
Confirm('contextConfirm', 'Is this your context?')
```

0 comments on commit dc57d1c

Please sign in to comment.