# legs

> light easy gulp scaffold

Latest version **1.0.1** (published 2016-09-14) · MIT license · 0 weekly downloads

## Install

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

## 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.0.1 |
| Published | 2016-09-14 |
| First published | 2016-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 17 |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | doodlewind |
| Maintainers | doodlewind |
| Keywords | gulp, scaffold, sass |

## Links

- npm: https://www.npmjs.com/package/legs
- Repository: https://github.com/doodlewind/legs
- Homepage: https://github.com/doodlewind/legs#readme
- Issues: https://github.com/doodlewind/legs/issues
- npm.io page: https://npm.io/package/legs

## Dependencies (17)

- [del](https://npm.io/package/del.md) ^2.2.1
- [chai](https://npm.io/package/chai.md) ^3.5.0
- [gulp](https://npm.io/package/gulp.md) ^3.9.1
- [mocha](https://npm.io/package/mocha.md) ^3.0.2
- [jquery](https://npm.io/package/jquery.md) ^1.11.1
- [gulp-if](https://npm.io/package/gulp-if.md) ^2.0.1
- [gulp-rename](https://npm.io/package/gulp-rename.md) ^1.2.2
- [gulp-uglify](https://npm.io/package/gulp-uglify.md) ^2.0.0
- [gulp-useref](https://npm.io/package/gulp-useref.md) ^3.1.0
- [gulp-changed](https://npm.io/package/gulp-changed.md) ^1.3.2
- [gulp-cssnano](https://npm.io/package/gulp-cssnano.md) ^2.1.2
- [gulp-replace](https://npm.io/package/gulp-replace.md) ^0.5.4
- [run-sequence](https://npm.io/package/run-sequence.md) ^1.2.2
- [gulp-ruby-sass](https://npm.io/package/gulp-ruby-sass.md) ^2.0.6
- [gulp-webserver](https://npm.io/package/gulp-webserver.md) ^0.9.1
- [gulp-file-include](https://npm.io/package/gulp-file-include.md) ^0.14.0
- [gulp-run-sequence](https://npm.io/package/gulp-run-sequence.md) ^0.3.2

## Recent versions

- 1.0.1 (latest) — 2016-09-14
- 1.0.0 (alpha) — 2016-09-03

## README

# legs
Light Easy Gulp Scaffold, automating build tasks tuned for lightweight front end development without AMD.

## Features
* Sass build automation.
* Configurable JS/CSS minify automation.
* Pure HTML template support.
* Trigger build task on file change with local web server.
* Configurable destination path and html extension, e.g.,`.jsp` or `.php`.
* Generator for new page, including html / stylesheet / script / test.

## Usage

### Install
Firstly install [gulp](http://gulpjs.com/) as global dependency, notice that `npm` can be replaced by [cnpm](https://npm.taobao.org/) for mainland China developers:

```
[sudo] npm install --global gulp 
```

Then clone legs:

``` bash
git clone https://github.com/doodlewind/legs.git
```

Install dependencies:

``` bash
cd legs && npm install
```

Installation done, start server and visit `localhost:8000` to test it out:

``` bash
gulp server
```

Now gulp watchs file changes in `src` and automatically builds the project. Mocha test cases for `index` is generated at `/src/test/index/test.html` and it's available to be executed in browser.

### File structure
Legs uses following file structure given `index.html` is generated by default:

``` text
├── gulpfile.js
├── package.json
├── node_modules //js libs for browser and gulp
└── src
    ├── html
    │   ├── index.html
    │   └── partials //common HTML template
    ├── js
    ├── sass
    │   ├── base
    │   ├── components
    │   ├── helpers
    │   ├── layout //page styles
    │   │   └── index
    │   │       └── _main.scss
    │   └── style-index.scss
    ├── scaffold
    └── test
        └── index //test cases
            ├── test.html
            └── test.js
```

### Commands
Custom gulp tasks are listed as below:

#### default
`gulp` or `gulp default` rebuilds all static resources in source path to their corresponding destination path, including scripts / stylesheets / images.

#### new
`gulp new -n foo` generates following files:

* `foo.html` in `src/html`
* `foo/main.js` in `src/js`
* `style-foo.scss` and its related Sass file structure in `src/sass`
* `test.js` in `src/test/foo` as mocha test case

#### watch
`gulp watch` watches file changes in `src` and triggers `gulp default`. This task does not start gulp-webserver.

#### server
`gulp server` runs `gulp watch` and starts gulp-webserver, also responds to file changes.

#### clean
`gulp clean` removes all files in resource and cache path. This task is executed before `default` and `watch`, so **don't put source file directly in destination path** or it'll be cleaned. Put your source file in corresponding `src` path and let gulp generate it to destination path.

#### clean-cache
`gulp clean-cache` removes:

* Sass cache.
* HTML generated in project root folder (generated for local web server).

Files generated in destination path won't be effected.

### Config
Options available in `gulpfile.js` are listed as below:

* `PRODUCTION`: `boolean`, enables JS / CSS minify when set to `true`.
* `HTML_EXT_NAME`: `string`, determines output html file suffix.
* `PORT`: `number`, the port number for local gulp-webserver.
* `PATH`: `json`, determines source and destination file path, relative to `gulpfile.js`.

## License
Legs is released under MIT License.

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