Skip to content

1 KB JavaScript library for building web applications.

License

Notifications You must be signed in to change notification settings

mjackson/hyperapp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hyperapp

Travis CI Codecov npm Slack

Hyperapp is a JavaScript library for building web applications.

  • Minimal: Hyperapp was born out of the attempt to do more with less. We have aggressively minimized the concepts you need to understand while remaining on par with what other frameworks can do.
  • Functional: Hyperapp's design is inspired by The Elm Architecture. Create scalable browser-based applications using a functional paradigm. The twist is you don't have to learn a new language.
  • Batteries-included: Out of the box, Hyperapp combines state management with a VDOM engine that supports keyed updates & lifecycle events — all with no dependencies.

Read the documentation to get started or try it online.

import { h, app } from "hyperapp"

const state = {
  count: 0
}

const actions = {
  down: () => state => ({ count: state.count - 1 }),
  up: () => state => ({ count: state.count + 1 })
}

const view = (state, actions) => (
  <main>
    <h1>{state.count}</h1>
    <button onclick={actions.down}>-</button>
    <button onclick={actions.up}>+</button>
  </main>
)

const main = app(state, actions, view, document.body)

Installation

Install with npm or Yarn.

npm i hyperapp

Then with a module bundler like Rollup or Webpack, use as you would anything else.

import { h, app } from "hyperapp"

If you prefer not to use a build system, you can load Hyperapp from unpkg or jsDelivr and it will be globally available through the window.hyperapp object.

<!doctype html>
<html>
<body>
  <script src="https://unpkg.com/hyperapp"></script>
  <script>

  const { h, app } = hyperapp

  </script>
</body>
</html>

We support all ES5-compliant browsers, including Internet Explorer 10 and above.

Community

License

Hyperapp is MIT licensed. See LICENSE.

About

1 KB JavaScript library for building web applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.9%
  • TypeScript 2.1%