1.0.3 • Published 2 years ago
@malrang-toy/wise-cat-saying v1.0.3
@malrang-toy/wise-cat-saying ·
This is a toy projects. this module is shown The WiseSaying with cute cat
Table of Contents
Installation
Manually
Simply include main.umd.js
in the <head>
...
<head>
...
<script src="main.umd.js"></script>
<!--
Or remotely via Unpkg CDN
<script src="https://unpkg.com/@malrang-toy/wise-cat-saying@1.0.2/dist/main.umd.js"></script>
-->
</head>
If you downloaded the package via zip file from Github, these files are located in the dist
folder. Otherwise, you can use the Unpkg CDN as shown in the examples above.
Via NPM
npm i @malrang-toy/wise-cat-saying
Files & locations:
File | Folder | Description |
---|---|---|
main.umd.js | node_modules/@malrang-toy/wise-cat-saying/dist | old school version |
main.esm.js | node_modules/@malrang-toy/wise-cat-saying/dist | ES module version |
Basic Usage for old-school
Write the element in markup file:
<head>
...
<script src="main.umd.js"></script>
<!--
Or remotely via Unpkg CDN
<script src="https://unpkg.com/@malrang-toy/wise-cat-saying@1.0.2/dist/main.umd.js"></script>
-->
</head>
<body>
...
<div id="my-cat-card"></div>
<script>
window.onload = function(){
console.log('window.onload')
const theCat = new WiseCatSaying('my-cat-card')
const theWord = theCat.actionSay()
console.log('theWord : ', theWord)
theCat.render()
}
</script>
</body>
Importing the library for javascript:
import WiseCatSaying from '@malrang-toy/wise-cat-saying';
// 'my-cat-card' is markup elemt ID
// ex) <div id="my-cat-card"></div>
const theCat = new WiseCatSaying('my-cat-card')
Basic Usage for ES module
Write the element in markup file:
<body>
...
<div id="my-cat-card"></div>
</body>
Importing the library for javascript:
import WiseCatSaying from '@malrang-toy/wise-cat-saying';
window.onload = function(){
// 'my-cat-card' is markup elemt ID
// ex) <div id="my-cat-card"></div>
const theCat = new WiseCatSaying('my-cat-card')
theCat.render()
}
Thank you !!