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 🙏

© 2024 – Pkg Stats / Ryan Hefner

app-lib-global

v1.0.0

Published

全局数据操作 -【app-lib-global】

Downloads

125

Readme

二、功能描述

* 支持nodejs 和 js

三、注意事项

六、API

Constants

Functions

ENV

支持的环境变量

*  NODE: 'node',       // ndoejs 环境
*  BROWSER: 'browser', // 浏览器环境

Kind: global constant

getEnv() ⇒ string

获取当前环境

Kind: global function
Returns: string - 当前环境常量

isNodeEnv() ⇒ Boolean

判断是否为nodejs环境

Kind: global function
Returns: Boolean - * true 是nodejs环境

  • false 不是nodejs环境

isBroswerEnv() ⇒ Boolean

判断是否为浏览器环境

Kind: global function
Returns: Boolean - * true 是浏览器环境

  • false 不是浏览器环境

getGlobal() ⇒ Object

获取当前运行环境的全局变量

  • 支持浏览器 window
  • 支持nodejs gloabl

Kind: global function
Returns: Object - - 获取的全局变量

  • window
  • global

getbindData(namespace) ⇒ any

获取绑定数据

Kind: global function
Returns: any - 已绑定的值

| Param | Type | Description | | --- | --- | --- | | namespace | string | 命名空间 |

bindToGlobal(namespace, bindData, [isForce]) ⇒ any

绑定数据到全局

Kind: global function
Returns: any - 全局已绑定的值

| Param | Type | Default | Description | | --- | --- | --- | --- | | namespace | string | | 命名空间 | | bindData | any | | 绑定数据 | | [isForce] | boolean | false | 是否强制绑定 - 存在当前值时,进行强制绑定 |

isBindToGlobal(namespace, [needbindData]) ⇒ boolean

是否也绑定到全局

  • needbindData 绑定对象不为undefined时:
  • 比对值相等 或者 json 序列化后相等 则表示已绑定

Kind: global function
Returns: boolean - 是否绑定

  • true 已绑定
  • false 未绑定

| Param | Type | Default | Description | | --- | --- | --- | --- | | namespace | string | | 命名空间 | | [needbindData] | Object | 'undefined' | 绑定对象 |