# 2019.08.06
[工具] Chrome 必装的插件,划词翻译功能是我目前用过的最舒服的:https://github.com/crimx/ext-saladict (opens new window)
[工具] 将链接转换为二维码的工具:https://chrome.google.com/webstore/detail/quick-qr-code-generator/afpbjjgbdimpioenaedcjgkaigggcdpp (opens new window)
[类库] dotenv-flow 可以加载 .env*
的文件,并且把文件的内容,存放到环境变量中:https://github.com/kerimdzhanov/dotenv-flow (opens new window)
[类库] 把 React 代码放到该组件中,就能实时看到代码中的效果。可以用于制作表单生成器使用,演示效果 (opens new window):https://github.com/uiwjs/react-code-preview (opens new window)
[类库] FileAPI 是文件操作 API,比如批量下载所有文件、生成图片缩略图、旋转图片:https://github.com/mailru/FileAPI (opens new window)
# 示例 - dotenv-flow
# .env.production.local
DATABASE_HOST=10.0.0.32
DATABASE_PORT=27017
DATABASE_USER=devops
DATABASE_PASS=1qa2ws3ed4rf5tg6yh
DATABASE_NAME=application_storage
require('dotenv-flow').config();
console.log('database host:', process.env.DATABASE_HOST);
console.log('database port:', process.env.DATABASE_PORT);
console.log('database user:', process.env.DATABASE_USER);
console.log('database pass:', process.env.DATABASE_PASS);
console.log('database name:', process.env.DATABASE_NAME);
# 示例 - FileAPI
// Get info of image file (FileAPI.exif.js included)
FileAPI.getInfo(file, function (err/**String*/, info/**Object*/){
if( !err ){
console.log(info); // { width: 800, height: 600, exif: {..} }
}
});