diff --git a/README.md b/README.md index e69de29..26d90df 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,31 @@ +Here’s a suggestion for your npm package description in English: + +```markdown +# ddmt-tool + +A utility library that provides commonly used functions to simplify everyday development tasks. Whether it's string manipulation, array operations, or other frequent functionalities, `ddmt-tool` helps you work more efficiently. + +## Installation + +```bash +npm install ddmt-tool +``` + +## Usage Example + +```javascript +import { Name } from 'ddmt-tool'; + +Name(); +``` + +## Features + +- String manipulation +- Array operations +- Custom utilities + +For more features and usage instructions, please refer to the documentation. +``` + +This should give users a clear understanding of your package's purpose and how to use it. \ No newline at end of file diff --git a/Tool/animate.js b/Tool/animate.js index 69149f8..577b38c 100644 --- a/Tool/animate.js +++ b/Tool/animate.js @@ -1,11 +1,21 @@ +/* + * @Author: ddmt + * @Date: 2024-9-29 20:50:12 + * @LastEditTime: 2024-9-29 20:50:12 + * @LastEditors: ddmt + * @Description: ddmt-index file + * @FilePath: /Tool/animate.js + */ + /** * 动画函数 * @param {HTMLElement} event * @param {string} classname */ -export function animate(event, classname) { - event.classList.add(classname); +export function animateStart(event, className, forceExecute) { + if (forceExecute) event.target.classList.remove(className); // 清洗动画 + event.classList.add(className); event.addEventListener('animationend', (event) => { - event.target.classList.remove(classname); // 清洗动画 + event.target.classList.remove(className); // 清洗动画 }); } diff --git a/Tool/number.js b/Tool/number.js index d3c181c..007f767 100644 --- a/Tool/number.js +++ b/Tool/number.js @@ -1,3 +1,12 @@ +/* + * @Author: ddmt + * @Date: 2024-9-29 20:50:12 + * @LastEditTime: 2024-9-29 20:50:12 + * @LastEditors: ddmt + * @Description: ddmt-index file + * @FilePath: /Tool/number.js + */ + //生成从minNum到maxNum的随机数 export function randomNum (minNum, maxNum) { switch (arguments.length) { diff --git a/index.js b/index.js index 5d6344c..510a5d8 100644 --- a/index.js +++ b/index.js @@ -1,2 +1,13 @@ -export { animate } from './Tool/animate.js'; -export { randomNum, nextArray } from './Tool/number.js'; \ No newline at end of file +/* + * @Author: ddmt + * @version: 1.0.5 + * @Date: 2024-9-29 20:50:12 + * @LastEditTime: 2024-9-29 20:50:12 + * @LastEditors: ddmt + * @Description: ddmt-index file + * @FilePath: /index.js + */ +export { animateStart } from './Tool/animate.js'; +export { randomNum, nextArray } from './Tool/number.js'; + +console.log('ddmt-tool Loading successfully!! 😺'); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ce2fc0b..1fb6166 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,20 @@ { "name": "ddmt-tool", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ddmt-tool", - "version": "1.0.4", - "license": "ISC" + "version": "1.0.5", + "license": "ISC", + "dependencies": { + "ddmt-tool": "file:" + } + }, + "node_modules/ddmt-tool": { + "resolved": "", + "link": true } } } diff --git a/package.json b/package.json index 71cae79..b70a995 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ddmt-tool", - "version": "1.0.4", - "description": "ddmt-tool", + "version": "1.0.5", + "description": "A utility library that provides commonly used functions to simplify everyday development tasks. Whether it's string manipulation, array operations, or other frequent functionalities, `ddmt-tool` helps you work more efficiently.", "main": "index.js", "type": "module", "scripts": { @@ -12,5 +12,8 @@ "tool" ], "author": "ddmt", - "license": "ISC" + "license": "ISC", + "dependencies": { + "ddmt-tool": "file:" + } }