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

csdnsynchexo

v3.2.3

Published

支持csdn/博客园/掘金/segmentfault/腾讯云加社区等平台一键迁移hexo

Downloads

93

Readme

支持 csdn/博客园/掘金/segmentfault/腾讯云加社区/github 等平台一键迁移 hexo

Usage

cli 使用

# help
npx csdnsynchexo@latest  --help
# 命令行
npx csdnsynchexo@latest --userId 289926799429704 --type juejin --output ./example
# or 指定配置文件
npx csdnsynchexo@latest --config ./config.json
{
  "userId": "289926799429704",
  "type": "juejin",
  "output": "./example"
}

example

api 使用

const { run } = require('csdnsynchexo')
const config = {
  userId: '289926799429704',
  type: 'juejin',
  output: './example',
}
run(config).then((res) => {
  console.log(res)
  //   {
  //   title: string
  //   date: string
  //   tags: string[]
  //   categories: string[]
  //   content: string
  // }[]
})

交互式输入 TODO

支持平台

csdn

  • type csdn

  • userId csdn 用户名。如https://blog.csdn.net/flytam的 flytam

  • output 输出路径。默认.

  • cookie

    • csdn cookie 信息,不提供则使用爬虫获取;提供则 api 获取
    • 获取方式:新开一个页面,F12(mac: cmd+shift+i)打开控制台,点击抓包这个请求的request headers中的cookie后面那段值

掘金

  • type juejin

  • userId 掘金用户 id。如https://juejin.cn/user/289926799429704/posts289926799429704

  • output 输出路径。默认.

  • cookie 掘金 cookie 信息。不提供使用非鉴权 api,部分老文章 markdown 格式可能有问题

博客园

  • type bokeyuan
  • userId 博客园用户 id。如https://www.cnblogs.com/flytam/flytam
  • output 输出路径。默认.

segmentfault

  • type segmentfault
  • userId segmentfault id。如https://segmentfault.com/u/flytamflytam
  • output 输出路径。默认.

腾讯云加社区

  • type tengxunyun
  • userId 腾讯云加社区 id。如https://cloud.tencent.com/developer/user/1132538/articles1132538
  • output 输出路径。默认.

github issue 博客

  • type github

  • userId githun 用户名,如https://github.com/flytam的 flytam

  • repo 写博客的仓库,如https://github.com/flytam/blog的 blog

    掘金小册

  • type juejin_book

  • userId 掘金小册id,如https://juejin.cn/book/7070324244772716556 的7070324244772716556

  • cookie 掘金已购买小册的账号cookie信息

高级选项 beta

图片自动转存

  • imgConfig 图片转存配置文件

部分网站有防盗链功能,支持配置自动转存,转存功能使用了PicGo。具体配置可参考 1 参考 2

例如:爬取掘金上的文章,图片转存上传到 github 上

1、新建一个 PiGo 配置文件,如(更多配置请参考 picgo)

// img.json
{
  "picBed": {
    "uploader": "github",
    "github": {
      "repo": "flytam/cdn",
      "token": "xxxxx",
      "path": "img/"
    }
  }
}

2、执行

npx csdnsynchexo@latest --config ./config.json
{
  "userId": "xxxx",
  "type": "juejin",
  "output": "./example",
  "imgConfig": "./img.json"
}

tips:网络原因呢转存 github 很容易超时。建议选择其它平台,参考 picgo

Run tests

# todo 简单测测
npm run test

Author

👤 flytam

  • Website: github.com/flytam/blog
  • Github: @flytam

🤝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 flytam. This project is MIT licensed.