just-utils
v0.4.1
Published
Some commonly used utils in daily business code development
Downloads
3
Readme
just-utils
Some commonly used utils in daily business code development. Lib provides limited functionality to support simple project which makes size of lib small.
Characteristics
- ApiSender - Simple encapsulation of web api fetch.
- SimpleDateFormat - Date Formatter which just support pattern: yyyy | M | MM | d | dd | H | HH | m | mm | s | ss.
Requirements
- Polyfill of fetch should be included independently if your browser doesn't support fetch api.
Compatibility
Unit tests guarantee support on the following environment:
| IE | CH | FF | SF | OP | IOS | Android | Node | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----- | | untested | untested | untested | untested | untested | untested | untested | untested |
Note: Compiling code depend on ES5, so you need import es5-shim to compatible with
IE6-8
, here is a demo
Directory
├── demo - Using demo
├── dist - Compiler output code
├── doc - Project documents
├── src - Source code directory
├── test - Unit tests
├── CHANGELOG.md - Change log
└── TODO.md - Planned features
Usage Instructions
Using npm, download and install the code.
$ npm install --save just-utils
For node environment:
var JustUtils = require('just-utils');
For webpack or similar environment:
import JustUtils from 'just-utils';
For requirejs environment:
requirejs(['node_modules/just-utils/dist/index.aio.js'], function (JustUtils) {
// do something...
})
For browser environment:
<script src="node_modules/just-utils/dist/index.aio.js"></script>
Documents
Contribution Guide
For the first time to run, you need to install dependencies firstly.
$ npm install
To build the project:
$ npm run build
To run unit tests:
$ npm test
Note: The browser environment needs to be tested manually under
test/browser
Modify the version number in package.json, modify the version number in README.md, modify the CHANGELOG.md, and then release the new version.
$ npm run release
Publish the new version to NPM.
$ npm publish