wsemi

A support package for web developer.

Usage no npm install needed!

<script type="module">
  import wsemi from 'https://cdn.skypack.dev/wsemi';
</script>

README

wsemi

A support package for web developer.

language npm version license gzip file size npm download jsdelivr download

Documentation

To view documentation or get support, visit docs.

Example

To view some examples for more understanding, visit examples:

lodash: ex-lodash.html [source code]

cryptojs: ex-cryptojs.html [source code]

dayjs: ex-dayjs.html [source code]

dayjs: ex-timeTZ2expire-timeTZ2past.html [source code]

colorConverter: ex-colorConverter.html [source code]

blob2b64: ex-blob2b64.html [source code]

domTooltip[with popper.js]: ex-domTooltip.html [source code]

domShowImages: ex-domShowImages.html [source code]

domShowImagesDyn[dynamic import]: ex-domShowImagesDyn.html [source code]

domConvertToPic: ex-domConvertToPic.html [source code]

domConvertToPicDyn[dynamic import]: ex-domConvertToPicDyn.html [source code]

domScrollIntoView: ex-domScrollIntoView.html [source code]

domScrollTo: ex-domScrollTo.html [source code]

domDropFiles: ex-domDropFiles.html [source code]

domDrag: ex-domDrag.html [source code]

domIsVisible: ex-domIsVisible.html [source code]

domRipple: ex-domRipple.html [source code]

strFindFuzz: ex-strFindFuzz.html [source code]

strFindFuzzDyn[dynamic import]: ex-strFindFuzzDyn.html [source code]

obj2u8arr & u8arr2obj: ex-obj2u8arr-u8arr2obj.html [source code]

getUserAgent: ex-getUserAgent.html [source code]

getUserAgentDyn[dynamic import]: ex-getUserAgentDyn.html [source code]

xss: ex-clearXSS.html [source code]

openlink: ex-openLink.html [source code]

xlsx: ex-xlsx.html [source code]

xlsx[dynamic import]: ex-xlsxDyn [source code]

html2pic: ex-html2pic.html [source code]

html2picDyn[dynamic import]: ex-html2picDyn.html [source code]

html2str: ex-html2str.html [source code]

html2strDyn[dynamic import]: ex-html2strDyn.html [source code]

ocr: ex-ocr.html [source code]

ocrDyn[dynamic import]: ex-ocrDyn.html [source code]

Installation

Using npm(ES6 module):

Note: wsemi is mainly dependent on lodash, eventemitter3, crypto-js, dayjs, fuzzball, ua-parser-js, xss, xlsx, tesseract.js, htmlparser and tippy.js.

npm i wsemi

In a browser(UMD module):

Note: umd file includes with lodash, crypto-js and tippy.js.

[Optional] Add script with nomodule for IE11.

<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>

[Optional] Add script for dayjs(or moment).

Note: Include script when using some function of time. If include moment, need set moment to window.dayjs (ex: window.dayjs = moment), and put it before include script for wsemi.umd.js.

<script src="https://cdn.jsdelivr.net/npm/dayjs@1.10.7/dayjs.min.js"></script>

or

<script src="https://cdn.jsdelivr.net/npm/moment@2.29.1/moment.min.js"></script>
<script>
  window.dayjs = moment
</script>

[Optional] Add script for fuzzball.

Note: Include script when using strFindFuzz function, and don't include script when using strFindFuzzDyn function.

<script src="https://cdn.jsdelivr.net/npm/fuzzball@2.0.2/dist/fuzzball.umd.min.js"></script>

[Optional] Add script for ua-parser-js.

Note: Include script when using getUserAgent function, and don't include script when using getUserAgentDyn function.

<script src="https://cdn.jsdelivr.net/npm/ua-parser-js@1.0.1/dist/ua-parser.min.js"></script>

[Optional] Add script for xss.

Note: Include script when using clearXSS function.

<script src="https://cdn.jsdelivr.net/npm/xss@1.0.10/dist/xss.min.js"></script>

[Optional] Add script for xlsx.

Note: Include script when using downloadExcelFileFromData or getDataFromExcelFileU8Arr function, and don't include script when using downloadExcelFileFromDataDyn or getDataFromExcelFileU8ArrDyn function.

<script src="https://cdn.jsdelivr.net/npm/xlsx@0.17.4/dist/xlsx.full.min.js"></script>

[Optional] Add link and script for viewerjs.

Note: Include script when using domShowImages function, and don't include script when using domShowImagesDyn function.

<link href="https://cdn.jsdelivr.net/npm/viewerjs@1.10.2/dist/viewer.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/viewerjs@1.10.2/dist/viewer.min.js"></script>

[Optional] Add script for html2canvas.

Note: Include script when using html2pic function, and don't include script when using html2picDyn function. Use canvg with nomodule for IE11.

<script nomodule src="https://cdn.jsdelivr.net/npm/canvg@3.0.7/lib/umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.3.2/dist/html2canvas.min.js"></script>

[Optional] Add script for html-to-image.

Note: Include script when using domConvertToPic function, and don't include script when using domConvertToPicDyn function. html-to-image does not support IE11 and Safari.

<script src="https://cdn.jsdelivr.net/npm/html-to-image@1.7.0/dist/html-to-image.js"></script>

[Optional] Add script for htmlparser.

Note: Include script when using html2str function, and don't include script when using html2strDyn function.

<script src="https://cdn.jsdelivr.net/npm/htmlparser@1.7.7/lib/htmlparser.min.js"></script>

[Optional] Add script for tesseract.js. It does not support IE11.

Note: Include script when using ocr function, and don't include script when using ocrDyn function.

<script src="https://cdn.jsdelivr.net/npm/tesseract.js@2.1.5/dist/tesseract.min.js"></script>

[Necessary] Add script for wsemi.

<script src="https://cdn.jsdelivr.net/npm/wsemi@1.6.45/dist/wsemi.umd.js"></script>