1.0.2 • Published 1 year ago

ftanktinipng v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

安装时请使用淘宝镜像,然后再使用 cnpm intall ftanktinipng npm config set registry http://registry.npm.taobao.org

nodejs 16.4 以上版本才支持两种开发模式并存(esm,cjs) esm 如果整个项目使用 esm 就必须在 package 中添加 "type":"module" nodejs 默认是 cjs 模式的("type":"commonjs") 如果 cjs 引用 esm,就需要在 js 文件中动态引入

import("./mjs/index.mjs").then((zip) => {
  var source = "E:\\tmp\\upload\\7933.png"
  var target = "E:\\tmp\\upload_new"
  zip.tinipng(source, target)
})

注意 esm 的 export 方式

export { tinipng }

文件后缀名是 js 还是 mjs 都可以的

如果生成文件路径不存在,则会自动创建

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago