An open API service indexing awesome lists of open source software.

https://github.com/generate/generate-webtask

Generate a starting point for a webtask.io service.
https://github.com/generate/generate-webtask

Last synced: 12 months ago
JSON representation

Generate a starting point for a webtask.io service.

Awesome Lists containing this project

README

          




Generate a starting point for a webtask.io service.

# generate-webtask

[![NPM version](https://img.shields.io/npm/v/generate-webtask.svg?style=flat)](https://www.npmjs.com/package/generate-webtask) [![NPM downloads](https://img.shields.io/npm/dm/generate-webtask.svg?style=flat)](https://npmjs.org/package/generate-webtask) [![Build Status](https://img.shields.io/travis/generate/generate-webtask.svg?style=flat)](https://travis-ci.org/generate/generate-webtask)

![generate-webtask demo](https://raw.githubusercontent.com/generate/generate-webtask/master/docs/demo.gif)

## Table of Contents

- [What is "Generate"?](#what-is-generate)
- [Getting started](#getting-started)
* [Install](#install)
* [Usage](#usage)
* [Help](#help)
- [Tasks](#tasks)
* [webtask:simple](#webtasksimple)
* [webtask:context](#webtaskcontext)
* [webtask:http](#webtaskhttp)
* [webtask](#webtask)
- [Files trees](#files-trees)
* [Generated files](#generated-files)
* [Source files](#source-files)
- [Next steps](#next-steps)
* [Running unit tests](#running-unit-tests)
* [Publishing your project](#publishing-your-project)
- [About](#about)
* [Related projects](#related-projects)
* [Community](#community)
* [Contributing](#contributing)
* [Running tests](#running-tests)
* [Author](#author)
* [License](#license)

_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_

## What is "Generate"?

Generate is a command line tool and developer framework for scaffolding out new GitHub projects using [generators](https://github.com/generate/generate/blob/master/docs/generators.md) and [tasks](https://github.com/generate/generate/blob/master/docs/tasks.md).

Answers to prompts and the user's environment can be used to determine the templates, directories, files and contents to build. Support for [gulp](http://gulpjs.com), [base](https://github.com/node-base/base) and [assemble](https://github.com/assemble/assemble) plugins, and much more.

**For more information**:

* Visit the [generate project](https://github.com/generate/generate/)
* Visit the [generate documentation](https://github.com/generate/generate/blob/master/docs/)
* Find [generators on npm](https://www.npmjs.com/browse/keyword/generate-generator) (help us [author generators](https://github.com/generate/generate/blob/master/docs/micro-generators.md))

## Getting started

### Install

**Installing the CLI**

To run the `webtask` generator from the command line, you'll need to install [Generate](https://github.com/generate/generate) globally first. You can do that now with the following command:

```sh
$ npm install --global generate
```

This adds the `gen` command to your system path, allowing it to be run from any directory.

**Install generate-webtask**

Install this module with the following command:

```sh
$ npm install --global generate-webtask
```

### Usage

Run this generator's `default` [task](https://github.com/generate/generate/blob/master/docs/tasks.md#default) with the following command:

```sh
$ gen webtask
```

**What you should see in the terminal**

If completed successfully, you should see both `starting` and `finished` events in the terminal, like the following:

```sh
[00:44:21] starting ...
...
[00:44:22] finished ✔
```

If you do not see one or both of those events, please [let us know about it](../../issues).

### Help

To see a general help menu and available commands for Generate's CLI, run:

```sh
$ gen help
```

## Tasks

All available tasks.

### [webtask:simple](generator.js#L23)

Generate an `index.js` file to the current working directory with a [simple webtask function](https://webtask.io/docs/model). Learn how to [customize behavior(#customization) or override built-in templates.

**Example**

```sh
$ gen webtask:simple
```

### [webtask:context](generator.js#L38)

Generate an `index.js` file to the current working directory with a [webtask function with context](https://webtask.io/docs/model). Learn how to [customize behavior(#customization) or override built-in templates.

**Example**

```sh
$ gen webtask:context
```

### [webtask:http](generator.js#L52)

Generate an `index.js` file to the current working directory with a [webtask function with full HTTP control](https://webtask.io/docs/model). Learn how to [customize behavior(#customization) or override built-in templates.

**Example**

```sh
$ gen webtask:http
```

### [webtask](generator.js#L65)

Alias for running the [webtask](#webtask) task with the following command:

**Example**

```sh
$ gen webtask
```

Visit Generate's [documentation for tasks](https://github.com/generate/generate/blob/master/docs/tasks.md).

## Files trees

The following files trees are automatically generated by a task in [verbfile.js](verbfile.js).

* [generated files](#generated-files): trees representing the actual generated "dest" files for each task
* [source files](#source-files): trees representing the source files and templates used by each task

_(See Generate's [customization docs ](https://github.com/generate/generate/blob/master/docs/customization.md) to learn how to override individual templates.)_

### Generated files

Files generated by each task (e.g. `dest` files). See the Generate [customization docs ](https://github.com/generate/generate/blob/master/docs/customization.md) to learn how to override individual templates.

Note that diffs are base on comparisons against the files generated by the `default` task. Additionally, some tasks generate the same files, but with different contents (for example, the contents of `index.js` differs based on the task).

#### default

Files generated by the [default task](#default):

```diff
.
└── index.js
```

#### simple

Files generated by the [simple task](#simple):

```diff
.
└── index.js
```

#### context

Files generated by the [context task](#context):

```diff
.
└── index.js
```

#### http

Files generated by the [http task](#http):

```diff
.
└── index.js
```

### Source files

The following trees represent the source files or templates that are used by each task. You'll see that most of the tasks use at least one "micro-generator" to generate a specific file.

#### default

Source files and/or libraries used by the [default task](#default):

```diff
.
└─┬ templates
└── index_simple.js
```

#### simple

Source files and/or libraries used by the [simple task](#simple):

```diff
.
└─┬ templates
└── index_simple.js
```

#### context

Source files and/or libraries used by the [context task](#context):

```diff
.
└─┬ templates
└── index_context.js
```

#### http

Source files and/or libraries used by the [http task](#http):

```diff
.
└─┬ templates
└── index_http.js
```

## Next steps

### Running unit tests

It's never too early to begin running unit tests. When you're ready to get started, the following command will ensure the project's dependencies are installed then run all of the unit tests:

```sh
$ npm install && test
```

### Publishing your project

If you're tests are passing and you're ready to publish your project to [npm](https://www.npmjs.com), you can do that now with the following command:

**Are you sure you're ready?!**

```sh
$ npm publish
```

## About

### Related projects

[generate](https://www.npmjs.com/package/generate): Command line tool and developer framework for scaffolding out new GitHub projects. Generate offers the… [more](https://github.com/generate/generate) | [homepage](https://github.com/generate/generate "Command line tool and developer framework for scaffolding out new GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.")

### Community

Are you using [Generate](https://github.com/generate/generate) in your project? Have you published a [generator](https://github.com/generate/generate/blob/master/docs/generators.md) and want to share your project with the world?

Here are some suggestions!

* If you get like Generate and want to tweet about it, please feel free to mention `@generatejs` or use the `#generatejs` hashtag
* Show your love by starring [Generate](https://github.com/generate/generate) and `generate-webtask`
* Get implementation help on [StackOverflow](http://stackoverflow.com/questions/tagged/generate) (please use the `generatejs` tag in questions)
* **Gitter** Discuss Generate with us on [Gitter](https://gitter.im/generate/generate)
* If you publish an generator, thank you! To make your project as discoverable as possible, please add the keyword `generategenerator` to package.json.

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

Please read the [contributing guide](contributing.md) for avice on opening issues, pull requests, and coding standards.

### Running tests

Install dev dependencies:

```sh
$ npm install -d && npm test
```

### Author

**Brian Woodward**

* [github/doowb](https://github.com/doowb)
* [twitter/doowb](http://twitter.com/doowb)

### License

Copyright © 2016, [Brian Woodward](https://github.com/doowb).
Released under the [MIT license](https://github.com/generate/generate-webtask/blob/master/LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on August 29, 2016._