roland-code-npm

1.0.9 • Public • Published

roland-code-npm

  • Roland's Code snippets for software development

Source code

Node environment

  • Install from the CLI: npm install roland-code-npm
  • Example using CommonJS require to load the module:
const { healthCheck } = require("roland-code-npm");
healthCheck();

Front-end environment

<script type="module">
  import { domUtils } from 'https://cdn.jsdelivr.net/npm/roland-code-npm@latest/index-client.js';
  const { $, createElem, randomNum } = domUtils;
  const randomImageUrl = () => 'https://source.unsplash.com/random?' + randomNum(1000);
  const img = createElem('img', { src: randomImageUrl() });
  img.addEventListener('click', (e) => {
    e.target.src = randomImageUrl();
  });
  $('.photo').appendChild(img);
</script>

Package Sidebar

Install

npm i roland-code-npm

Weekly Downloads

14

Version

1.0.9

License

ISC

Unpacked Size

7.16 kB

Total Files

7

Last publish

Collaborators

  • rolandjlevy