# metalsmith-dev-server

> Development server for Metalsmith

Latest version **0.2.0-0** (published 2018-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install metalsmith-dev-server
pnpm add metalsmith-dev-server
yarn add metalsmith-dev-server
bun add metalsmith-dev-server
```

Provides the command `metalsmith-dev-server`.

## 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.2.0-0 |
| Published | 2018-09-23 |
| First published | 2018-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 86.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Rico Sta. Cruz |
| Maintainers | rstacruz |
| Keywords | browser-sync, browsersync, livereload, metalsmith, server |

## Links

- npm: https://www.npmjs.com/package/metalsmith-dev-server
- Repository: https://github.com/rstacruz/metalsmith-dev-server
- Homepage: https://github.com/rstacruz/metalsmith-dev-server#readme
- Issues: https://github.com/rstacruz/metalsmith-dev-server/issues
- npm.io page: https://npm.io/package/metalsmith-dev-server

## Dependencies (4)

- [meow](https://npm.io/package/meow.md) 5.0.0
- [throat](https://npm.io/package/throat.md) 4.1.0
- [debounce](https://npm.io/package/debounce.md) 1.2.0
- [browser-sync](https://npm.io/package/browser-sync.md) 2.24.7

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.2.0-0 (latest) — 2018-09-23

## README

# metalsmith-dev-server

> Development server for Metalsmith websites

metalsmith-dev-server is a simple, yet powerful tool to allow you to develop sites using the [Metalsmith] static site tool. Featuring:

- Compatible with any Metalsmith project
- Scroll syncing, network throttling, and more (via [Browsersync])
- Live reload of CSS changes

[Browsersync]: https://browsersync.io/
[Metalsmith]: http://metalsmith.io/

## Usage

:package: **Install** — add this into your Metalsmith project.

```sh
npm install --save-dev github:rstacruz/metalsmith-dev-server
```

:pencil2: **Create metalsmith.js** — Your project should have a file that exports the Metalsmith project.

```js
/*
 * Example metalsmith.js:
 * This builds the site when ran via `node metalsmith.js`.
 * When used as `require('./metalsmith')`, it returns the
 * app instance.
 */

const Metalsmith = require('metalsmith')

const app = Metalsmith(__dirname)
  .source('web')
  .destination('public')

if (module.parent) {
  module.exports = app
} else {
  app.build(err => { if (err) { console.error(err.message); process.exit(1) } })
}
```

:memo: **Add scripts** — Add this to *package.json*.

```js
"scripts": {
  "dev": "metalsmith-dev-server metalsmith.js --watch web"
}

// This example runs the Metalsmith app in `metalsmith.js`,
// and auto-rebuilds when files in `web/` is changed.
```

:red_car: **Start the server** — Use your new script:

```sh
npm run dev
```

Or to specify another port:

```sh
npm run dev -- --port 3820
```

## Also see

[metalsmith-start](https://www.npmjs.com/package/metalsmith-start) is a more complex solution with other features, such as production mode.

## Thanks

**metalsmith-dev-server** © 2017+, Rico Sta. Cruz. Released under the [MIT] License.<br>
Authored and maintained by Rico Sta. Cruz with help from contributors ([list][contributors]).

> [ricostacruz.com](http://ricostacruz.com) &nbsp;&middot;&nbsp;
> GitHub [@rstacruz](https://github.com/rstacruz) &nbsp;&middot;&nbsp;
> Twitter [@rstacruz](https://twitter.com/rstacruz)

[![](https://img.shields.io/github/followers/rstacruz.svg?style=social&label=@rstacruz)](https://github.com/rstacruz) &nbsp;
[![](https://img.shields.io/twitter/follow/rstacruz.svg?style=social&label=@rstacruz)](https://twitter.com/rstacruz)

[MIT]: http://mit-license.org/
[contributors]: http://github.com/rstacruz/metalsmith-dev-server/contributors

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