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

coding-net

v0.1.1

Published

Open API for Coding.net

Downloads

6

Readme

Coding API

安装和引入

安装

npm install coding-net --save

引用

ES5:

var coding = require('coding-net');

ES6:

import coding from 'coding-net';
// 或
import { user, tweet } from 'coding-net';

使用说明

coding.user('username') 用户信息

参数:

  • username: 用户名(Global Key),下文中如遇用户名,均相同。

ES5 Example:

// User
coding.user('willin').then(function(data) {
  console.log(data);
});

ES6 Example:

// User
(async ()=>{
  const user = await coding.user('willin');
  console.log(user);
})();

结果:

{
  tags_str: 'Mac, Node.js, 极客, 技术风向标, 全栈攻城狮',
  tags: '9,12,31,32,38',
  job_str: '打杂',
  job: 6,
  sex: 0,
  birthday: '1989-06-03',
  location: '江苏 南京',
  company: '南京物联传感',
  slogan: 'To be Willin is to be willing.',
  introduction: '',
  avatar: 'https://dn-coding-net-production-static.qbox.me/e87b264d88631de777ecfe2abb602de6.jpg',
  gravatar: '',
  lavatar: 'https://dn-coding-net-production-static.qbox.me/e87b264d88631de777ecfe2abb602de6.jpg',
  created_at: 1413940756000,
  last_logined_at: 1459669263000,
  last_activity_at: 1459686053606,
  global_key: 'willin',
  name: 'willin',
  name_pinyin: '',
  updated_at: 1459669254000,
  path: '/u/willin',
  status: 1,
  is_member: 0,
  id: 36560,
  points_left: 0.54,
  follows_count: 1,
  fans_count: 2,
  tweets_count: 0,
  followed: false,
  follow: false
}

coding.user.projects('username', options) 用户公开项目

参数:

  • username: 用户名
  • options:
    • page: 页码,默认1
    • pageSize: 每页条数,默认10
    • type: 类型,默认joined。 参与:joined,收藏:stared

coding.user.topic('username', options) 用户参与话题

参数:

  • username: 用户名
  • options:
    • extraInfo: 附加信息,默认1
    • page: 页码,默认1
    • pageSize: 每页条数,默认10

coding.user.activities('username', options) 用户公开动态

参数:

  • username: 用户名
  • options:
    • type: 类型,默认all。全部:all,项目相关:project,冒泡相关:tweet

coding.tweet('username', options) 冒泡

参数:

  • username: 用户名
  • options:
    • type: 类型,默认my。TA自己的:my,TA赞过的:liked,TA评论过的:commented

示例

参考 examples目录。

// 安装babel-node
npm install -g babel-node
// 编译
npm run compile
// 执行
babel-node examples/user.js
// 或
babel-node examples/user.es6
babel-node examples/tweet.js
babel-node examples/tweet.es6