百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

stateman

> 编程语言
开源

一个为复杂的网络应用提供嵌入状态路由的微小基础.

386 stars0 点赞4 次浏览
访问官网GitHub

工具介绍

一个为复杂的网络应用提供嵌入状态路由的微小基础.

StateMan

stateman: A tiny foundation that provides nested state-based routing for complex web applications.

stateman is highly inspired by ui-router; you will find many features similar to it.

But stateman is a standalone library with an extremely tiny codebase (5kb minified). Feel free to integrate it with whatever framework you like!

Reference

  • English
  • 中文手册

Feature

  1. nested routing support.
  2. standalone with tiny codebase.
  3. async routing support if you need asynchronous logic in navigating. Support Promise
  4. html5 history supported, fallback to hash-based in old browser.
  5. concise API, deadly simple to getting start with it.
  6. support IE6+ and other modern browsers.
  7. well tested, born in large product.

Quick Start

You may need a static server to run the demo. puer is simple to get start.

just paste the code to your own index.html, and load it up in a browser.

xml

  
  StateMan Test
  

  
/home"

  
/contact"

  
/contact/list

  
/contact/2

  
/contact/2/option

  
/contact/2/message

  

open the console to see the output when navigating.

Demos

###1. Simple Layout Demo:

The code in this demo is for demonstration only. In a production development, you will want a view layer to create nested views.

###2. A simple SPA built upon Regularjs (Living Template) + requirejs + stateman: Link

I create a simple wrapping (regular-state) to integrate stateman with Regularjs, which makes it easy to build a single Page Application. thanks to the concise API, the code is very clean. You will find that integrating stateman with other libraries is also simple.

Browser Support

  1. Modern browsers, including mobile devices
  2. IE6+

Installation

Bower

javascript
bower install stateman

stateman.js have been packaged as a standard UMD, so you can use it in AMD, CommonJS and as a global.

npm (browserify or other based on commonjs)

javascript
npm install stateman

To use:

javascript
var StateMan = require('stateman');

spm

javascript
spm install stateman

To use:

javascript
var StateMan = require('stateman');

Component

javascript
component install leeluolee/stateman

To use:

javascript
var StateMan = require('leeluolee/stateman');

Direct downloads

  1. stateman.js
  2. stateman.min.js

Examples

Some basic examples can be found in the examples directory.

run demo local

  1. clone this repo
  2. npm install gulp -g && npm install
  3. gulp server
  4. check the example folder

LICENSE

MIT.

ChangLog

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言