0.0.8 • Published 5 years ago

@ghostship/core v0.0.8

Weekly downloads
12
License
MIT
Repository
github
Last release
5 years ago

Ghostship

Configurable SPA router

npm bundle size

Features

Usage

npm i @ghostship/core @ghostship/react
or
yarn add @ghostship/core @ghostship/react
import React from 'react'
import ReactDom from 'react-dom'
import { Ghostship } from '@ghostship/core'
import { GhostshipComponent } from '@ghostship/react'

import { HomePage, PostPage, NotFoundPage } from './components/pages'

const ghostship = new Ghostship(
  // routes tree
  [{
    path: '/',
    component: HomePage,
  }, {
    path: '/post/:slug',
    components: PostPage,
  }],
  // options
  {
    trailingSlash: true,
    notFound: NotFoundPage
  }
)

ReactDom.render(
  <GhostshipComponent instance={ghostship} />,
  document.getElementById('react')
)

And, of course, lot of documentation in docs

Motivation

There are plenty of client-side routing libraries, but all of them meet my criteria: be lightweight (<10kb) and support middlewares or guargs out-of-the-box. So i've just made Ghostship. Enjoy, please. Pr is welcome.

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago