0.0.3 • Published 8 months ago

@xutil/file v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

File 文件

x-file文件

📦 安装

  • 使用 npm 安装

    npm install @xutil/file -S
  • HTML直接引入

    <!DOCTYPE html>
       <html lang="en">
       <body>
          <script src="/dist/index-umd.js"></script>
          <script>
          </script>
       </body>
    </html>

🎨 使用

  • ESM导入使用

    // 全部引入
    import { downloadFile } from "@xutil/file"
     console.log(downloadFile(window.href, "测试文件名称", "txt"))
    
    // 按需引入
    import XFile from "@xutil/file"
     console.log(XFile.downloadFile(window.href, "测试文件名称", "txt"))
  • RequireJS导入使用

    // 全部引入
    const XFile = require('@xutil/file')
    console.log(XFile.downloadFile(window.href, "测试文件名称", "txt"))
    
    // 按需引入
    const { downloadFile } = require('@xutil/file')
    console.log(downloadFile(window.href, "测试文件名称", "txt"))

方法

   downloadFile                     字节长度
0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago