A Roadmap
Ctrlk
  • Introduction
  • Roadmap
  • Basics
    • Basic Terminal Usage
    • Character Encoding
    • Data Structures & algorithms
    • Network
    • Version Control
    • Principles
    • Design Patterns
    • Others
  • Front End
    • Web Standard
    • Development
    • Libs & frameworks
    • Platforms
  • Back End
    • outline
    • Languages
  • Clients
    • outline
    • 安装 IPA 包
  • DevOps
    • Languages
    • OS Concepts
    • Servers & terminal
  • UI & UX
    • outline
  • Others
    • Posts
    • Tools
      • 个人常用的工具分享
      • tmux 简要笔记
Powered by GitBook
On this page
  1. Others

Tools

必备工具

  • alfred

  • alfred workflows

查文档

  • dash

  • jsdoc 语法

  • can i use

便捷工具

  • 三角形生成器

正则

  • RegExr: Learn, Build, & Test RegEx

图形图像

  • 在线 ico 图标制作

转码

  • 图片转 ASCII

  • WEBP 轉 JPG 轉換器

  • ASCII Generator

数据统计

  • 浏览器市场份额 - 百度统计流量研究院

常用 Node Package

  • sharpJS 图形转码

    • my example code

  • fluent-ffmpeg 音视频转码

    • example code

Previous记一次 vue + ts 开发踩坑Next个人常用的工具分享

Last updated 6 years ago

Was this helpful?

  • 必备工具
  • 查文档
  • 便捷工具
  • 正则
  • 图形图像
  • 转码
  • 数据统计
  • 常用 Node Package

Was this helpful?

const ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
const ffmpeg = require('fluent-ffmpeg');
const fs = require('fs');
const util = require('util');
const path = require('path');
ffmpeg.setFfmpegPath(ffmpegInstaller.path);
const [readdir, readFile] = [fs.readdir, fs.readFile].map(util.promisify);

async function readFiles() {
  try {
    const dir = path.resolve('./raw');
    const outputDir = path.resolve('./output');
    const files = await readdir(dir, 'utf8');
    files.forEach(file => {
      const { name } = path.parse(file);
      const fileName = path.resolve(dir, file);
      const outputFileName = path.resolve(outputDir, `${name}.mp3`);
      ffmpeg(fileName)
        .format('mp3')
        .save(outputFileName);
      console.log(`${name} is converted`);
    });
  } catch (error) {
    console.log(error);
  }
}

readFiles();