npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

staple.js

v1.2.0

Published

Staple is a handset SPA(single page web appliction) framework bases on [Prototype](http://prototypejs.org/) and [RequireJS](http://requirejs.org/). It implements complete page load/navigation logic and many other details, so developers can focus on their

Readme

Staple

Staple is a handset SPA(single page web appliction) framework bases on Babel and RequireJS. It implements complete page load/navigation logic and many other details, so developers can focus on their business. At the same time, object-oriented programming style makes code clean and maintainable. Staple can work with many other js libraries and frameworks, such as jQuery and bootstrap. Also, Staple is a perfect companion of Cordova to create a native-like App.

Staple是一个专为移动设备设计的SPA(单页面Web应用)开发框架。Staple解决了SPA应用开发过程中的许多细节问题,以便于让开发者专注与实际业务逻辑的开发。Staple基于BabelRequireJS构建,提供了一种面向对象的、模块化的开发方式,使得的代码更易阅读和维护。Staple被设计成一个单纯的SPA框架,因此能很好的与其它JS框架集成,例如jQueryBootstrap等。另外,Staple可以与Cordova完美结合来开发接近原生体验的App。以下是Staple的主要特性:

Features:

  • Fully object-oriented programming, modular programming.
  • Resources(HTML/CSS/JavaScript) lazy loading, demand loading.
  • Page load/navigation managment, with CSS animations.
  • Page lifecycle managment.
  • State staging and recovery when refresh or navigate back from other website.
  • Transfer data between pages.
  • Open specified page via url query parameters.
  • I18n Support.

特性:

  • 完全的面向对象编程风格,模块化编程
  • 资源(HTML/CSS/JavaScript)懒加载、按需加载
  • 界面加载和跳转管理,支持自定义CSS动画
  • 界面生命周期管理
  • 状态暂存及恢复,在页面刷新后或从其它页面后退回来时能恢复到离开时的状态
  • 界面间数据传递
  • 通过URL Query参数直接跳转的指定的界面
  • 国际化(I18n)支持

Install Staple 安装Staple

Install Staple via npm:

通过npm来安装Staple:

$ npm install -g staple.js

How to start 如何开始

Create a new folder.

创建一个新的文件夹。

$ mkdir /some/path/to/your/project
$ cd /some/path/to/your/project

Create a new project via "staple.js" CLI.

通过“staple.js”命令行工具来创建一个新项目

$ staple.js init
project name: (project) stapledemo
version: (1.0.0) 1.0.0
description: A staple project demo.
author: Eric.Tsai
use jquery: (yes) yes
use art template: (yes) yes
use weui: (yes) yes
use typescript: (yes) yes

creating project "stapledemo" ...
done.

run "npm install" to install dependencies.
then run "npm start" to start.

There are 4 options: jQuery, artTemplate, WeUI and TypeScript.

jQuery is the most popular JavaScript framework that makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler. artTemplate is an effective HTML render framework. WeUI is the official UI framework of the WeChat app. TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.

You can disable any of them by setting corresponding option to "no".

创建项目时有4个可选项:jQuery,artTemplate,WeUI和TypeScript.

jQuery是最流行的JavaScript框架,可以使HTML文档遍历和操作,事件处理,动画以及Ajax等工作更简便。 artTemplate是一个高效的HTML渲染框架。 WeUI是微信官方的UI框架。 TypeScript是一个强类型的JavaScript超集,可以被编译成JavaScript。

你可以把对应的选项设置为“no”来关闭以上的任何一个特性。

Install dependencies:

安装依赖项:

$ npm install

Start project:

启动项目

$ npm start

License 许可证

Apache License, Version 2.0