Skip to content

Instantly share code, notes, and snippets.

View lichangwei's full-sized avatar
🎯
Focusing

lichangwei lichangwei

🎯
Focusing
View GitHub Profile
'use strict';
exports.main_handler = async (event, context, callback) => {
const axios = require("axios");
const url =
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=f0dae1fb-43d9-4047-a9e5-78989503e238";
await axios.post(url, {
msgtype: "text",
text: {
content: "又一天过去了,今天我做了什么,收获了什么,记得写周报总结一下吧",
mentioned_list: ["@all"]
@lichangwei
lichangwei / i18n.ts
Created December 1, 2021 06:22
extract i18n keys from typescript source code
import ts from 'typescript';
const filename = ts.findConfigFile(process.cwd(), ts.sys.fileExists, 'tsconfig.json');
if (!filename) throw Error('tsconfig.json not found');
const { config } = ts.readConfigFile(filename, ts.sys.readFile);
const { options, fileNames } = ts.parseJsonConfigFileContent(config, ts.sys, process.cwd());
const program = ts.createProgram({
options,
rootNames: fileNames,