@malrang-toy/wise-cat-saying

1.0.3 • Public • Published

@malrang-toy/wise-cat-saying · npm version

This is a toy projects. this module is shown The WiseSaying with cute cat

Get a word with Cat

Get a word with 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 !!

Origin Source From

Cat image : https://thecatapi.com/

WiseSaying : google(?)

Readme

Keywords

Package Sidebar

Install

npm i @malrang-toy/wise-cat-saying

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

14.9 kB

Total Files

5

Last publish

Collaborators

  • seniya2