ok-cli
Hyperminimal development server for React & MDX
Last updated a year ago by jxnblk .
MIT · Original npm · Tarball · package.json
$ cnpm install ok-cli 
SYNC missed versions from official npm registry.

ok-cli

Hyperminimal dev server for React & MDX

  • :zero: Zero config
  • :headphones: No plugins
  • ???? Smart defaults
  • :atom_symbol: Render React or MDX
  • :fire: Blazing
npm i -g ok-cli
ok docs/hello.mdx

Using React

ok-cli will render the default exported component of a module.

// example App.js
import React from 'react'

export default props =>
  <h1>Hello</h1>
ok docs/App.js

Using MDX

MDX is a superset of markdown, which lets you mix JSX with markdown syntax.

import Button from './Button'

# Markdown Heading

<Button>React Component</Button>

Layouts

MDX also supports layouts with React components. The default export in an MDX file will wrap the contents of the document.

// example Layout.js
import React from 'react'

export default ({ children }) =>
  <div
    style={{
      padding: 32,
      maxWidth: 768,
      margin: 'auto'
    }}>
    {children}
  </div>
import Layout from './Layout'

export default Layout

# Hello

Components

ok-cli has built-in support for customizing the components used in MDX. Export a named components object from the MDX document to customize the MDX markdown components.

// example components.js
import React from 'react'

export default {
  h1: props => <h1 {...props} style={{ color: 'tomato' }} />
}
export { default as components } from './components'

# Hello

Options

  • --port, -p Port for the dev server
  • --no-open Prevent opening in default browser

Node API

const start = require('ok-cli')

const options = {
  entry: './src/App.js'
}

start(options)
  .then(({ app, middleware, port }) => {
    console.log('listening on port:', port)
  })

MIT License

Current Tags

  • 2.0.0-22                                ...           alpha (a year ago)
  • 3.1.1                                ...           latest (a year ago)
  • 3.0.0-9                                ...           next (a year ago)

79 Versions

  • 3.1.1                                ...           a year ago
  • 3.1.0                                ...           a year ago
  • 3.0.4                                ...           a year ago
  • 3.0.3                                ...           a year ago
  • 3.0.2                                ...           a year ago
  • 3.0.1                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 3.0.0-9                                ...           a year ago
  • 3.0.0-8                                ...           a year ago
  • 3.0.0-7                                ...           a year ago
  • 3.0.0-6                                ...           a year ago
  • 3.0.0-5                                ...           a year ago
  • 3.0.0-4                                ...           a year ago
  • 3.0.0-3                                ...           a year ago
  • 3.0.0-2                                ...           a year ago
  • 3.0.0-1                                ...           a year ago
  • 3.0.0-0                                ...           a year ago
  • 2.0.9                                ...           a year ago
  • 2.0.8                                ...           a year ago
  • 2.0.7                                ...           a year ago
  • 2.0.6                                ...           a year ago
  • 2.0.5                                ...           a year ago
  • 2.0.4                                ...           a year ago
  • 2.0.3                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 2.0.0-65                                ...           a year ago
  • 2.0.0-64                                ...           a year ago
  • 2.0.0-35                                ...           a year ago
  • 2.0.0-39                                ...           a year ago
  • 2.0.0-38                                ...           a year ago
  • 2.0.0-37                                ...           a year ago
  • 2.0.0-36                                ...           a year ago
  • 2.0.0-34                                ...           a year ago
  • 2.0.0-33                                ...           a year ago
  • 2.0.0-32                                ...           a year ago
  • 2.0.0-31                                ...           a year ago
  • 2.0.0-30                                ...           a year ago
  • 2.0.0-29                                ...           a year ago
  • 2.0.0-28                                ...           a year ago
  • 2.0.0-27                                ...           a year ago
  • 2.0.0-26                                ...           a year ago
  • 2.0.0-25                                ...           a year ago
  • 2.0.0-24                                ...           a year ago
  • 2.0.0-23                                ...           a year ago
  • 2.0.0-22                                ...           a year ago
  • 2.0.0-21                                ...           a year ago
  • 2.0.0-20                                ...           a year ago
  • 2.0.0-18                                ...           a year ago
  • 2.0.0-17                                ...           a year ago
  • 2.0.0-16                                ...           a year ago
  • 2.0.0-15                                ...           a year ago
  • 2.0.0-14                                ...           a year ago
  • 2.0.0-13                                ...           a year ago
  • 2.0.0-12                                ...           a year ago
  • 2.0.0-10                                ...           a year ago
  • 2.0.0-8                                ...           2 years ago
  • 2.0.0-7                                ...           2 years ago
  • 2.0.0-6                                ...           2 years ago
  • 2.0.0-5                                ...           2 years ago
  • 2.0.0-4                                ...           2 years ago
  • 2.0.0-3                                ...           2 years ago
  • 2.0.0-2                                ...           2 years ago
  • 2.0.0-1                                ...           2 years ago
  • 2.0.0-0                                ...           2 years ago
  • 1.0.0-19                                ...           2 years ago
  • 1.0.0-18                                ...           2 years ago
  • 1.0.0-17                                ...           2 years ago
  • 1.0.0-16                                ...           2 years ago
  • 1.0.0-15                                ...           2 years ago
  • 1.0.0-14                                ...           2 years ago
  • 1.0.0-13                                ...           2 years ago
  • 1.0.0-12                                ...           2 years ago
  • 1.0.0-11                                ...           2 years ago
  • 1.0.0-10                                ...           2 years ago
  • 1.0.0-9                                ...           2 years ago
  • 1.0.0-8                                ...           2 years ago
  • 1.0.0-7                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 396
Dependencies (22)
Dev Dependencies (3)

Copyright 2014 - 2016 © taobao.org |