npm install basic-tools- Common utility function packages(常用的实用工具函数包)
- npm-url:npm
- github-url:github
You can install with npm:
```
$ npm install basic-tools
``
import basicTools from 'basic-tools'
basicTools.query('name', '?name=js') //return 'js'
`
$3
- Function for turn the object into a url string
`
basicTools.serialize({hello: 'js'}) //return '?hello=js'
`
$3
- Function for simulating jQuery
`
basicTools.$(selector) //return {DOM|undefined}
`
$3
- Function for Deleting DOM node
`
basicTools.removeNode(node) //delete {node}
`
$3
- Function for inserting the node node after the target node
`
basicTools.insertAfter(node, target)
`
$3
- Function for add class name
`
basicTools.addClass(node, className) //add class
`
$3
- Function for remove class name
`
basicTools.removeClass(node, className) //removeClass
`
$3
- Function for get absolute url
`
basicTools.getAbsoluteUrl('/xxxx') //return 'https://github.com/xxxx'
`
$3
- Function for avoiding shake
$3
- Function for remove item by index
`
basicTools.removeItemByIndex(1, [1, 2, 3]) //return [1, 3]
``