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

jike-api

v0.27.3

Published

Jike api for browser - compatible with browser plugins

Downloads

3

Readme

jike-api

Unit Test GitHub node-lts npm type definitions GitHub Repo stars GitHub forks Jike (followers) 本项目仅供学习交流使用,在使用过程中对你或他人造成的任何损失我们概不负责。

[!TIP] 本项目持续维护。

Features

本项目是在 open-jike/jike-sdk 基础上修改的,主要改进了对浏览器插件的支持。

优化了部分 API,提高了兼容性和性能,并将持续更新维护。

Installation

Node.js

Node.js >= v18.12.0

npm i jike-sdk

ESM 导入

如果使用 ESM 方式导入,需要把 package.jsontype 设置为 module,或将后缀名改为 .mjs

// index.mjs

// 使用此版本需 node >= 18 或 自行 ployfill fetch。
import { setApiConfig } from 'jike-sdk'

setApiConfig({
  // ...
})

CJS 导入

const { setApiConfig } = require('jike-sdk')
setApiConfig({
  // ...
})

Bun

Bun >= 0.5.8

bun i jike-sdk
// index.ts
import { setApiConfig } from 'jike-sdk'
setApiConfig({
  // ...
})

Deno

import { setApiConfig } from 'https://cdn.skypack.dev/jike-sdk/index?dts'

浏览器

import { setApiConfig } from 'jike-sdk'

或使用 CDN 的方式加载(与 Deno 一致)

<script type="module">
  import { setApiConfig } from 'https://cdn.skypack.dev/jike-sdk/index'
</script>

由于 CORS 策略的原因,第三方网站无法直接请求外部服务器。但可以使用浏览器扩展的能力请求。

Usage

API Reference

import { ApiClient, api, setAccessToken, setApiConfig } from 'jike-sdk'

// 自行在 GitHub 搜索「jike endpoint」探索配置
const apiConfig = {
  endpointId: 'jike',
  endpointUrl: 'https://api.ruguoapp.com/',
  bundleId: 'com.ruguoapp.jike',
  buildNo: '2961',
  appVersion: '7.56.2',
  userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Jike/7.56.2 /sa-sdk-ios/sensors-verify/tr.ruguoapp.com?jike',
  accessToken: '<access-token>', // 请自行替换
}
setApiConfig(apiConfig)

setAccessToken('update-access-token')
api.userRelation.getFollowingList('29910575-F12D-4E48-9DDE-B25FE55D1F94', {
  limit: 100,
})

// 或使用 ApiClient
const client = ApiClient(apiConfig)
client.users.profile()

Contributing PRs Welcome

see CONTRIBUTING.md

License

AGPL-3.0 License © 2020-PRESENT River