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

vme50

v1.0.2

Published

疯狂星期四,v me 50

Downloads

8

Readme

vme50

疯狂星期四,v me 50

来源

当然就是网上热火的 V 我 50 了。然后就想着收集一下表情包、文案放到仓库里,也是一个很无聊的项目……

之后会稍微写个后端,这样就可以直接调用 API 来调用这个仓库了。欢迎各位 PR 添加文案以及图片地址!数据链接

周四调用 vme50 的时候会报错:

Error: Crazy Thursday need ¥50

文档

打包的时候有带 .d.ts 文件,理论上支持 TypeScript 这里就只展示 TypeScript 代码示例

安装

npm install vme50

vme50

import vme50 from 'vme50'

// 如果今天是星期四,你会收获一条报错:Error: Crazy Thursday need ¥50
// 并且返回疯狂星期四文案一篇
vme50()

vme50(options?: Options) 接收 options 作为可选参数,参数声明如下

interface Options {
  console?: boolean              // 默认为 false
  type?: 'warn' | 'error'        // 默认为 error
  returnUndefined?: boolean      // 默认为 true
  resultType?: 'text' | 'image'  // 默认为 text
}
  1. type 参数为 warn,则在星期四的时候会调用 console.warn('Warning: Crazy Thursday need ¥50'),此时 console 参数的值将忽略
  2. type 参数为 errorconsolefalse 在星期四将会直接 throw 'Error: Crazy Thursday need ¥50',若 consoletrue 则只会 console.error('Error: Crazy Thursday need ¥50')
  3. returnUndefined 参数为 true 则不在星期四的时候将会返回 undefined,若为 false 会根据 resultType 返回文案或图片链接
  4. resultType 参数为 text,将会返回文案,为 image 将会返回图片链接
  5. 请注意,如果函数已经 throw 了之后肯定就没有返回值了,即当星期四的时候 consoletruetypeerror 时,returnUndefinedresultType 都是没有用的

vme50Text 和 vme50Image

import { vme50Text, vme50Image } from 'vme50'

console.log(vme50Text())  // 随机返回一条疯狂星期四文案
console.log(vme50Image()) // 随机返回一条疯狂星期四图片链接