This package has been deprecated

Author message:

this package have been archived. please install the @all-in-js/utils instead.

@iuv-tools/utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

utils

常用的脚本操作函数集合,避免易出bug的点,统一交互风格

Install

npm i @iuv-tools/utils

Example

该包提供了一批易出bug的函数、易于调用的函数,如resolve, resolveCWD, resolveDirname, resolveHome等

  • git操作
// 有文件更改则提交更改

const { git } = require('@iuv-tools/utils');

const { clean } = git.hasChanges;

if (!clean) {
  git.commitAll('update sth.');
}
  • vue-cli风格的logger
const { log } = require('@iuv-tools/utils');

log.info('msg', 'tag');
  • 命令行spinner
const { spinner } = require('@iuv-tools/utils');

spinner.step('start...');
// do sth
spinner.success('success');
  • npm操作
const { npm } = require('@iuv-tools/utils');

const pkgTags = npm.tag.list('@iuv-tools/utils');
  • 钉钉群消息提醒
const { DDWebhook } = require('@iuv-tools/utils');

const secret = 'srcret';
const webhook = 'webhook';
new DDWebhook({
  secret,
  webhook
}).sendMessage('msg')
.then(console.log)
.catch(console.log);
  • ast抽象语法树操作
const { astCtrl } = require('@iuv-tools/utils');

function visitorCreater(t) {
  // 
}

const code = astCtrl('code', visitorCreater);

Plan

持续完善中,欢迎加入!

Readme

Keywords

none

Package Sidebar

Install

npm i @iuv-tools/utils

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

64.9 kB

Total Files

13

Last publish

Collaborators

  • eryue