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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@suin/esa-exporter

v1.0.0

Published

esa.io APIから全データをエクスポートするライブラリ

Downloads

5

Readme

@suin/esa-exporter

esa.io API から全データをエクスポートするライブラリ。

esa.io のエクスポート機能はマークダウンファイルがダウンロードできるだけで、他の情報が入ってこないためこれを開発しました。

特徴

  • エクスポートに対応しているデータ
    • メンバー
    • 投稿
      • コメント
      • stargazers

インストール

yarn add @suin/esa-exporter
# or
npm install @suin/esa-exporter

使い方

基本的な用法:

import { exportAll, Entity } from "@suin/esa-exporter";

(async () => {
  const team = process.env.ESA_TEAM;
  const token = process.env.ESA_TOKEN;
  const entities: Entity[] = [];

  for await (const entity of exportAll({ team, token })) {
    entities.push(entity);
  }

  console.log(entities);
})();

出力例:

[
  {
    $type: "member",
    myself: true,
    name: "Taro Tanaka",
    screen_name: "tanaka",
    icon:
      "https://img.esa.io/uploads/production/users/1/icon/thumb_m_********.png",
    role: "owner",
    posts_count: 222,
    joined_at: "2014-07-01T08:10:55+09:00",
    last_accessed_at: "2019-12-27T16:23:23+09:00",
    email: "[email protected]",
  },
  {
    $type: "member",
    myself: false,
    name: "Hanako Sato",
    screen_name: "sato",
    icon:
      "https://img.esa.io/uploads/production/users/2/icon/thumb_m_********.jpg",
    role: "owner",
    posts_count: 111,
    joined_at: "2014-07-01T08:19:26+09:00",
    last_accessed_at: "2019-08-13T18:07:24+09:00",
    email: "[email protected]",
  },
  {
    $type: "post",
    number: 1,
    name: "esa APIの使い方",
    full_name: "日報/2015/05/09/esa APIの使い方 #api #dev",
    wip: true,
    body_md: "...",
    body_html: "...",
    created_at: "2015-05-09T11:54:50+09:00",
    message: "初稿です!",
    url: "https://example.esa.io/posts/1",
    updated_at: "2015-05-09T11:54:51+09:00",
    tags: ["api", "dev"],
    category: "日報/2015/05/09",
    revision_number: 1,
    created_by: {
      myself: true,
      name: "Taro Tanaka",
      screen_name: "tanaka",
      icon:
        "https://img.esa.io/uploads/production/users/1/icon/thumb_m_********.png",
    },
    updated_by: {
      myself: true,
      name: "Taro Tanaka",
      screen_name: "tanaka",
      icon:
        "https://img.esa.io/uploads/production/users/1/icon/thumb_m_********.png",
    },
  },
];

exportAllは様々なエンティティをごちゃまぜで返してくるので、 エンティティ種別ごとに何らかの処理をする必要がある場合は、Entity[$type]で分岐処理を書いてください:

import { exportAll, Member, Post } from "@suin/esa-exporter";

(async () => {
  const team = process.env.ESA_TEAM;
  const token = process.env.ESA_TOKEN;

  const members: Member[] = [];
  const posts: Post[] = [];

  for await (const entity of exportAll({ team, token })) {
    switch (entity.$type) {
      case "member":
        members.push(entity);
        break;
      case "post":
        posts.push(posts);
        break;
    }
  }
})();

API リファレンス

https://suin.github.io/esa-exporter/