# static-base-preset

> A static-base setup

Latest version **0.3.1** (published 2016-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install static-base-preset
pnpm add static-base-preset
yarn add static-base-preset
bun add static-base-preset
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2016-08-31 |
| First published | 2016-06-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | icid.asset@gmail.com |
| Maintainers | icidasset |
| Keywords | static |

## Links

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

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [express](https://npm.io/package/express.md) ^4.14.0
- [chokidar](https://npm.io/package/chokidar.md) ^1.6.0
- [minimatch](https://npm.io/package/minimatch.md) ^3.0.3

## Recent versions

- 0.3.1 (latest) — 2016-08-31
- 0.3.0 — 2016-08-29
- 0.2.2 — 2016-06-29
- 0.2.1 — 2016-06-29
- 0.2.0 — 2016-06-25
- 0.1.0 — 2016-06-24

## README

# Static Base Preset

This is the foundation I use together with [`static-base`](https://github.com/icidasset/static-base) and [`static-base-contrib`](https://github.com/icidasset/static-base-contrib).
It includes:

- A simple static server (acts like `surge.sh`).
- A simple file watcher.
- A utility function that wraps the `static-base.run` function,
  which makes it a sequence that only runs when needed and logs a message.
- Metadata functions (store_env_info).
- Utility functions for checking the current environment.



## How to use

```js
import { exec, runWithMessageAndLimiter } from 'static-base-preset';
import { read, frontmatter, write } from 'static-base-contrib';


const markdown = (files) => files.map(file => ({
  ...file,
  content: renderMarkdown(file.content),
}));


const sequence = (attr, resultOfPreviousSequence) => runWithMessageAndLimiter
  ('Reading and writing')
  (attr.priv.changedPath)
  (
    read,
    frontmatter,
    markdown,
    [write, attr.priv.buildDirectory]
  )
  (`${attr.priv.sourceDirectory}/*.md`, attr.priv.root);


exec([
  sequence

], {
  rootDirectory: __dirname,
  buildDirectory: 'build',
  sourceDirectory: 'src',

}).then(
  results => console.log('Success!', results),
  error => console.error(error.stack || error.toString())

);
```

__Flags__

```bash
--watch # Watch for changes in the source directory
--serve # Set up a server for the build directory

# Example

npm run dev -- --watch --serve
```



## Documentation

[http://icidasset.github.io/static-base-preset](http://icidasset.github.io/static-base-preset)

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