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 🙏

© 2026 – Pkg Stats / Ryan Hefner

saber-lang

v2.0.1

Published

适合 移动端 & node 环境的语言增强模块,提供了extend, inherits, curry等函数。

Readme

saber-lang

Bower version NPM version Build Status License EFE Mobile Team

适合 移动端 & node 环境的 语言增强 模块。

Installation

浏览器环境下,通过 edp 引入模块:

$ edp import saber-lang

node 环境下,通过 npm 引入模块:

$ npm install saber-lang --save

Usage

var lang = require('saber-lang');

var targetObj = {x: 1, y: 2};
var sourceObj = {y: 3, z: 4};
lang.extend(targetObj, sourceObj);

console.log(targetObj); // {x: 1, y: 3, z: 4}

API

Base 部分是最基础的语言增强函数,在 require('saber-lang') 时加载。

Methods

extend(target, ...source)

对象属性拷贝。

  • target {Object} 目标对象
  • source {...Object} 源对象
  • return {Object}

inherits(subClass, superClass)

为类型构造器建立继承关系。

  • subClass {Function} 子类构造器
  • superClass {Function} 父类构造器
  • return {Function}

curry(fn[, ...args])

为函数提前绑定前置参数(柯里化)。

  • fn {Function} 要绑定的函数
  • args {...*=} 函数执行时附加到执行时函数前面的参数
  • return {Function}

bind(fn, thisArg[, ...args])

为函数绑定this与前置参数。

  • fn {Function} 要绑定的函数
  • thisArg {Object} 需要绑定的this
  • args {...*=} 函数执行时附加的前置绑定参数
  • return {Function}

Optional

浏览器环境下 还提供以下可选模块,使用时需要单独引用。