Giter Site home page Giter Site logo

script-toolkit's Introduction

Script-Toolkit

License NPM version

Description

JavaScript工具箱子,前端业务开发工具,提高开发效率

Usage

1. 静态引入

(1) script标签直接引

下载/dist/index.iife.js,该打包文件暴露jsTools变量,可直接使用。

<script src="~/index.iife.js"></script>
<script>
	console.log(jsTools)
</script>

(2) es模式引入

下载/dist/index.esm.js,该打包文件直接export出工具函数。

import { * as jsTools } from '~/index.esm.js'
console.log(jsTools)

import { checkType } from '~/index.esm.js'
checkType('123')

(2) CommonJS模式引入

下载/dist/index.cjs.js,该打包文件通过module.exports,适用于node、webpack。

const jsTools = require('~/index.cjs.js')
console.log(jsTools)

2. npm / yarn引入

npm:

npm i script-toolkit

yarn:

yarn add script-toolkit

code:

import { * as jsTools } from 'script-toolkit'
console.log(jsTools)

Document

在线API文档(需要外网支持):api-doc-page

todo:Markdown文档

Todo

  • 支持浏览器环境,node 环境、es6 环境
  • 拆分代码,es模式中按需引入
  • 构建工具由webpack转为rollup
  • 增加@babel/polyfill垫片兼容低版本js
  • 引入代码校验工具 eslint
  • 自动化生成 api 文档
  • 添加代码测试工具

script-toolkit's People

Contributors

hulkye avatar

Stargazers

 avatar 龙佚 avatar BLOCKCHAIN DEV avatar  avatar Ricky Yin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.