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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mp3toamr

v1.0.1

Published

Self-contained Linux x64 CLI for converting MP3 audio to AMR-NB files

Readme

mp3toamr

把 MP3 音频转换成 AMR-NB 的命令行工具。

npm install -g mp3toamr
mp3toamr --input ./input.mp3 --output ./output.amr

包内已直接包含 Linux x64 的 ffmpeg 二进制,因此安装时不再需要额外下载它。

当前支持

  • Linux x64
  • Node.js 12+

安装后的运行时不依赖 apt install ffmpegapt install libopencore-amrnb-dev。包内会直接使用:

  • 随包分发的预编译 ffmpeg
  • 随包分发的 AMR-NB 编码器二进制

可选参数

mp3toamr \
  --input ./input.mp3 \
  --output ./output.amr \
  --ffmpeg /custom/path/ffmpeg \
  --encoder /custom/path/amrnb-encode

输出规格

输出为标准 AMR-NB:

  • 8kHz
  • 单声道
  • 12.2 kbps(MR122)

发布到 npm

这个包已经按公开发布方式配置好了,发布时执行:

npm login
npm run release:publish

如果你的 npm 账号启用了 2FA for publishing,发布时需要附带一次性 OTP:

npm run release:publish -- --otp=123456

注意:用 npm token create 在 CLI 里生成的普通 publish token 仍然可能被 2FA 拦截。要在无 OTP 的场景发布,需要去 npm 网站创建 granular access token,并开启 bypass 2FA

如果你是在当前仓库里维护这个包,并且需要重新生成随包分发的 Linux x64 编码器,可执行:

npm run build:vendor

build:vendor 会同时刷新随包分发的 ffmpeg 和 AMR-NB 编码器二进制。

正式发布前,也可以先做一次完整的 dry-run 检查:

npm run release:check

如果后续把代码放到 GitHub 仓库里,有两种自动发布方式:

  1. .github/workflows/publish.yml:使用 NPM_TOKEN,要求它是 允许 bypass 2FA 的 granular access token
  2. .github/workflows/publish-trusted.yml:使用 npm Trusted Publishing / OIDC,不需要保存 token

Trusted Publishing 需要你先在 npm 包设置页把这个 GitHub 仓库和工作流文件名 publish-trusted.yml 配成 trusted publisher。完成后,GitHub Release 发布即可自动发包。