Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@ewtd/eutils

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ewtd/eutils

EUtils -- Ewt front end generic methods library!

latest
npmnpm
Version
1.0.12
Version published
Maintainers
0
Created
Source

EUtils

EWT前端工具库

一、安装

1. 直接引入eUtils.min.js

  <script src="eUtils.min.js"></script>
  <script>
    var test = EUtils.test();
  </script>

2. npm/yarn安装

npm install --save @ewtd/eutils

二、使用

1. 整包引用

import EUtils from '@ewtd/eutils';

const demo = EUtils.test();

2. 引用具体某一函数

import { durationFormat } from '@ewtd/eutils';

const demo = durationFormat(60);

三、客户端按需打包配置

客户端工程中引入时,为了减小最终打包后的包体积,可引入按需打包技术,工程最终只会将你项目中用到的方法打包,未引用的方法将不会被打入最终的目标文件,配置方法如下:

1. 安装依赖

为了实现按需打包,引入插件:babel-plugin-import

npm install --save-dev babel-plugin-import

2. 配置.babelrc

{
  "plugins":[["import",
    {
      "libraryName": "@ewtd/eutils",
      "libraryDirectory": "src",
      "camel2DashComponentName": false,
      "camel2UnderlineComponentName": false,
    }
  ]]
}

四、文档

文档站

https://admin.mistong.com/eutils/manual/global.html

文档站更新

  • 执行命令 yarn run docs 生成最新文档到 out 目录;
  • 拷贝 out 目录下的内容到 eutils-doc 仓库的 dist/manual 目录下;
  • 打开 eutils-doc 仓库的 release 分支并提交代码到 git 仓库;

eutils-doc git 仓库地址是 http://git.mistong.com/commonjs/eutils-doc

  • 前往自动发布平台搜索 eutils-doc,发布即可;

Keywords

E-Utils

FAQs

Package last updated on 29 Aug 2024

Did you know?

Socket

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