Socket
Socket
Sign inDemoInstall

ftanktinipng

Package Overview
Dependencies
240
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ftanktinipng

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


Version published
Weekly downloads
3
Maintainers
1
Install size
8.06 MB
Created
Weekly downloads
 

Readme

Source

安装时请使用淘宝镜像,然后再使用 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 都可以的

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

FAQs

Last updated on 12 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc