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

@yqsl-cd/auth

v0.0.8

Published

元气森林-登陆鉴权

Readme

元气森林,登陆、鉴权组件

基于元气森林-技术工程部服务,用于在PC端或者飞书浏览器进行登陆、鉴权

安装

npm install @yqsl-cd/auth

或者使用yarn命令

yarn add @yqsl-cd/auth

使用

import yqslAuth from '@yqsl-cd/auth'
...
yqslAuth.loginLark(...)

API

loginLark(params)

  • 说明

    pc端飞书登录

  • params参数定义

    | 参数名 | 必填 | 参数类型 | 说明 | | --------- | ---- | ----------------------- | ------------------------ | | appCode | 是 | string | 应用标识 | | env | 否 | 'test'|'uat'|'prod' | 当前环境,默认test | | width | 否 | number | 弹窗宽度,默认585 | | height | 否 | number | 弹窗高度,默认648 | | onSuccess | 否 | (token: string) => void | 成功回调,参数为token | | onFail | 否 | (error: string) => void | 失败回调,参数为失败原因 |

  • 返回

    void

  • 实例

    yqslAuth.loginLark({
    	appCode: 'infra-op',
    	env: 'uat',
    	onSuccess: (token) => {
    		console.log('token:', token)
    	},
    	onFail: (err) => {
    		console.log('login err:', err)
    	}
    })

getUrlByLark(params)

  • 说明

    返回在飞书浏览器中,登陆需要跳转的地址

  • params参数定义

    | 参数名 | 必填 | 参数类型 | 说明 | | -------- | ---- | --------------------- | ------------------------- | | appCode | 是 | string | 应用标识 | | pathname | 是 | string | 回调路径,如'/checkToken' | | env | 否 | 'test'|'uat'|'prod' | 当前环境,默认test | | search | 否 | string | 回调查询信息,如'a=1&b=2' |

  • 返回

    string | null

  • 实例

    if (/Lark/i.test(window.navigator.userAgent)) {
        const urlAuth = yqslAuth.getUrlByLark({
            appCode: 'infra-op',
            pathname: '/checkToken',
            env: 'uat',
            search: 'pageBeforeLogin=%2Findex%3Fa%3D1%26b%3D2'
        })
          
        if (urlAuth !== null) {
        	window.location.href = urlAuth;
        }
    }
    // 小技巧:可以通过search传递登录前页面,如%2Findex%3Fa%3D1%26b%3D2 => /index?a=1&b=2
    // 如登录成功,页面会跳转至/checkToken?token={token}&pageBeforeLogin=%2Findex%3Fa%3D1%26b%3D2
    // 可在checkToken页面,通过校验token是否有效