# merely

> A react/webpack server framework with almost no setup.

Latest version **0.1.9** (published 2017-02-15) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

Provides the command `merely`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.9 |
| Published | 2017-02-15 |
| First published | 2017-01-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 23 |
| Known vulnerabilities | 0 (+9 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | manspaniel |

## Links

- npm: https://www.npmjs.com/package/merely
- npm.io page: https://npm.io/package/merely

## Dependencies (23)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [express](https://npm.io/package/express.md) ^4.14.0
- [resolve](https://npm.io/package/resolve.md) ^1.2.0
- [webpack](https://npm.io/package/webpack.md) ^1.14.0
- [json-loader](https://npm.io/package/json-loader.md) ^0.5.4
- [babel-loader](https://npm.io/package/babel-loader.md) ^6.2.5
- [serve-static](https://npm.io/package/serve-static.md) ^1.11.1
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.20.0
- [babel-polyfill](https://npm.io/package/babel-polyfill.md) ^6.23.0
- [babel-register](https://npm.io/package/babel-register.md) ^6.18.0
- [react-hot-loader](https://npm.io/package/react-hot-loader.md) ^3.0.0-beta.6
- [babel-preset-react](https://npm.io/package/babel-preset-react.md) ^6.16.0
- [webpack-dev-server](https://npm.io/package/webpack-dev-server.md) ^1.16.1
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.16.0
- [webpack-dev-middleware](https://npm.io/package/webpack-dev-middleware.md) ^1.9.0
- [webpack-hot-middleware](https://npm.io/package/webpack-hot-middleware.md) ^2.13.2
- [babel-plugin-react-require](https://npm.io/package/babel-plugin-react-require.md) ^3.0.0
- [babel-plugin-module-resolver](https://npm.io/package/babel-plugin-module-resolver.md) ^2.4.0
- [babel-plugin-transform-runtime](https://npm.io/package/babel-plugin-transform-runtime.md) ^6.15.0
- [babel-plugin-transform-async-functions](https://npm.io/package/babel-plugin-transform-async-functions.md) ^6.8.0
- [babel-plugin-transform-class-properties](https://npm.io/package/babel-plugin-transform-class-properties.md) ^6.19.0
- [babel-plugin-transform-async-to-generator](https://npm.io/package/babel-plugin-transform-async-to-generator.md) ^6.16.0
- [babel-plugin-transform-object-rest-spread](https://npm.io/package/babel-plugin-transform-object-rest-spread.md) ^6.20.2

## Recent versions

- 0.1.9 (latest) — 2017-02-15
- 0.1.8 — 2017-02-15
- 0.1.7 — 2017-02-13
- 0.1.5 — 2017-02-13
- 0.1.4 — 2017-02-13
- 0.1.3 — 2017-02-02
- 0.1.2 — 2017-01-20
- 0.1.1 — 2017-01-09
- 0.1.0 — 2017-01-09

## README

# Merely
A react/webpack server framework with almost no setup.

# Idea
* Minimal fucking around
* BYO React
* ES6, with async/await
* Server-side rendering
* Easy async data-fetching for components (even on the server 😍)
* Support for [Redux](http://redux.js.org/), [React Router](https://react-router.now.sh/) and [Styled Components](https://github.com/styled-components/styled-components)
* Write server code, so that you can implement API endpoints and whatever else you want/need
* Three simple commands:
  * `mere dev` — run a hot reloading dev server
  * `mere build` — build your project, ready for production
  * `mere prod` — start the production version of your app (run this after `mere build`!)

# Folder structure
Just like a Node.JS app makes use of `node_modules` and `package.json`, Merely has three files it'll look for when you run your app.

## `server.js`

This file is automatically required by mere when running your app, both in dev and production modes. The file should export a function, which should at the very least begin listening on a port.

It's also your chance to add any extra request handlers that you might want to add to express! This file will be transformed by Babel, using the same plugins and transforms available for use in client code. This means you can use ES6, JSX, the spread operator and async/await! ✨

```js
module.exports = function(app, isDev) {
  
  // Some kinda cool thing that we might want to use
  app.use('/getCats', (req, res) => {
    res.end(JSON.stringify({
      cats: ["Tuffy", "Maggie", "Pepper"]
    }));
  })
  
  // Listen on port 8080
  app.listen(8080);
  
}
```

## `client/main.js`

This file shouldn't actually do anything except export some things. Merely handles the boot process for you, so you don't have to worry about initializing React.

Most importantly, you should export your primary application component from this file. It'll be passed a few properties, which you can distribute to child components like React Router and whatever else.

```js

export const App = require('./components/App');

```

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