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

lavender-account

v1.1.3

Published

Lavender Account 是与 Wisteria Account 一同推出的,专为处理、调用账户数据而设计的简化方案。

Downloads

20

Readme

Lavender-Account

功能描述

Lavender Account 是与 Wisteria Account 一同推出的,专为处理、调用账户数据而设计的简化方案。

使用方法

首先列出 Lavender Account 的内置组件

| 名称 | 类型 | 功能 | | ------------------- | ------------ | --------------------------- | | connect | 函数(异步) | 连接数据库 | | login | Promise 对象 | 使用用户名和密码登录 | | signUp | Promise 对象 | 根据用户名、密码注册新账户 | | deleteAccount | Promise 对象 | 删除指定账户 | | editProfile | Promise 对象 | 编辑用户信息 | | auth | Promise 对象 | 根据用户名和 token 进行鉴权 |

以下针对各组件介绍使用方法

  1. connect(host, user, password, database) 四个参数分别为服务器地址、数据库用户名、数据库密码和数据库名称,连接成功后返回 {ok: 1};连接失败则报错
  2. login(username, password) 若用户名和密码正确,则返回 {token: xxx},建议将 token 保存为浏览器 cookie;若不正确,或在登录中遇到其他错误,则返回相应的错误码
  3. signUp(username, password) 若用户名未被注册,返回 {ok: 1},表示新用户注册成功;若已被注册或遇到其他错误,则返回相应的错误码
  4. deleteAccount(username) 删除账户,或返回错误码,注意:实际应用中需先进行鉴权
  5. editProfile(username, key, value) 修改账户信息,或返回错误码,注意:实际应用中需先进行鉴权
  6. auth(username, token) 是 nodejs 中 express 框架下的中间件,根据用户的 request 请求,读取 request.cookies,并和 request.query.username 一起进行登录鉴权,将其放在 express 路由中可实现“仅登录用户可使用”的功能