# create-static

> Create static HTML pages with ESNext, SCSS and Nunjucks.

Latest version **1.0.1** (published 2017-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install create-static
pnpm add create-static
yarn add create-static
bun add create-static
```

Provides the command `create-static`.

## 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 | 2017-11-28 |
| First published | 2017-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Dmitri Voronianski |
| Maintainers | dmitri |
| Keywords | cli, nunjucks, scss, js, es6, browserify, esnext, client, html |

## Links

- npm: https://www.npmjs.com/package/create-static
- Repository: https://github.com/voronianski/create-static
- Homepage: https://github.com/voronianski/create-static#readme
- Issues: https://github.com/voronianski/create-static/issues
- npm.io page: https://npm.io/package/create-static

## Dependencies (15)

- [ora](https://npm.io/package/ora.md) ^1.3.0
- [async](https://npm.io/package/async.md) ^2.5.0
- [envify](https://npm.io/package/envify.md) ^4.1.0
- [yamljs](https://npm.io/package/yamljs.md) ^0.3.0
- [walkdir](https://npm.io/package/walkdir.md) 0.0.12
- [babelify](https://npm.io/package/babelify.md) ^7.3.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^4.0.2
- [nunjucks](https://npm.io/package/nunjucks.md) ^3.0.1
- [optimist](https://npm.io/package/optimist.md) ^0.6.1
- [node-sass](https://npm.io/package/node-sass.md) ^4.5.3
- [uglify-js](https://npm.io/package/uglify-js.md) ^3.1.3
- [babel-core](https://npm.io/package/babel-core.md) ^6.26.0
- [browserify](https://npm.io/package/browserify.md) ^14.4.0
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.24.1
- [babel-preset-stage-0](https://npm.io/package/babel-preset-stage-0.md) ^6.24.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-11-28
- 1.0.0 — 2017-11-28

## README

# create-static

> Create static html pages with ESNext, SCSS and Nunjucks.

## Install

```bash
npm i create-static --save-dev
```

## Usage

### CLI

```bash
Usage: create-static -s ./path/to/src -o ./path/to/dist

Options:
  --source, -s   path to source folder containing all promo folders
  --output, -o   path to dist folder with resulted builds
  --help, -h     print help
  --version, -v  print version
```

### Code

```js
const createStatic = require('create-static');
const source = './path/to/src';
const output = './path/to/dist';

createStatic.run({ source, output })
  .then(() => {
    console.log('Success!');
  })
  .catch(err => {
    console.log(err);
  });
```

### Source structure

Every folder in source folder should have following structure:

- `index.html` - required, html powered by nunjucks template engine
- `content.yml` - optional, data to render inside html
- `index.js` - optional, javascript powered by [browserify](https://github.com/browserify/browserify) and [babelify](https://github.com/babel/babelify) (uses `es2015` and `stage-0` presets)
- `indes.scss` - optional, css powered by [node-sass](https://github.com/sass/node-sass)
- `assets` - optional folder to store all static files (it will be copied into build)

```bash
.
|____dist
|____src
| |____page-1
| | |____index.html # required
| | |____index.js
| | |____index.scss
| |____page-2
| | |____assets
| | | |____icon.png
| | | |____some-webfont.woff
| | |____index.html # required
| | |____index.scss
| |____page-3
| | |____content.yml
| | |____index.html # required
| | |____index.scss
# as many folders as you want...
```

```bash
create-static -s ./src -o ./dist
# will output all ready to use files in `dist` folder
```

---

**MIT Licensed**

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