npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kreditojs

v0.2.1

Published

[![](https://data.jsdelivr.com/v1/package/npm/kreditojs/badge)](https://www.jsdelivr.com/package/npm/kreditojs)

Downloads

8

Readme

KreditoJS

The idea

KreditoJS ("Kreditoj" means "credits" in esperanto) is a really simple lib to create a credits page with team development and publish in easy way. Is like a credits in a final of the movie.

You can see an example at final of this readme.

Usage

This lib was created using Vue in version 3. You can just import the vue lib, the KreditoJS lib and use. See an example bellow:

<html>
<head>
    <!-- Import the stylesheet bellow -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/kreditojs@latest/dist/Kreditojs.css" />
    <title>Credits | Powered by KreditoJS</title>
</head>

<body>
    <!-- div with id to render the component -->
    <div id="app"></div>

    <!-- Import vue lib and kreditojs -->
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.global.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/kreditojs@latest/dist/Kreditojs.umd.min.js"></script>

    <script>
        <!-- Configuration and instance. More details about configuration bellow -->
        window.screenplay = { /* .... */ }; // You can see examples here: https://github.com/tacnoman/kreditojs/tree/master/examples
        window.Vue.createApp(window.Kreditojs).mount('#app');
    </script>
</body>

You must set the variable window.screenplay with credits configuration to Kreditojs render with your data.

Creating the variable screenplay

The Kreditojs uses this variable to create components. There are some types of components:

  1. TitleWithSub - A component that appear with a title and a subtitle
  2. Credits - Credits as a slider rolling to up.

Creating scenes

You must add an attribute to window.screenplay called scenes as an array.

window.screenplay = {
  scenes: [
    { ... }
  ],
};

Each scene must have two attributes:

  1. componentName: A string with name of the component
  2. props: Object with props to component

Example:

window.screenplay = {
  scenes: [
    {
      componentName: 'TitleWithSub',
      props: {
        title: 'Directed by',
        subtitle: 'Kevin Feige',
      },
    },
  ],
};

This code will generate the image bellow:

Example of component Credits

The component Credits has an attribute to add in props called components. This attributes works like scenes, because you must add multiple components inside.

The child components to Credits is:

  1. Title
  2. SideBySide
  3. SimpleList

The component Title has just a prop attribute called title.

Ex:

  window.screenplay = {
    scenes: [
      {
        componentName: 'Credits',
        props: {
          components: [
            {
              componentName: 'Title',
              props: {
                title: 'Cast',
              },
            },
            // ......

The component SideBySide has a prop called values with an array of arrays. The first value of each array will be place in left size. The second value will be placed in the right side. If the second attribute is an array, will be place a list instead of a unique text.

Ex:

  window.screenplay = {
    scenes: [
      {
        componentName: 'Credits',
        props: {
          components: [
            {
              componentName: 'SideBySide',
              props: {
                values: [
                    ['Design', ['Roth Wigfall', 'Gledstane Shirlee']],
                    ['Development', ['Kaitlynn Saleway', 'Higgan Lincoln', 'Marshall Willcott', 'Shepperd Caltera']],
                    ['P.M.', 'Winnifred Tackle'],
                    ['P.O.', 'Tandy Huggons'],
                    ['S.M.', 'Manya Alti'],
                    ['Big data', 'Godfry Orae'],
                    ['Dess Code Reference', 'Cassandry Donson'],
                  ],
                },
              },
            },
            // ....

Another component is the SimpleList. Has a prop called lines with an array of string.

Ex:

  window.screenplay = {
    scenes: [
      {
        componentName: 'Credits',
        props: {
          components: [
            {
              componentName: 'SimpleList',
              props: {
                lines: [
                    'Jovani Jerde',
                    'Raheem Hoeger',
                    'Alec Runte',
                    'Wolf Raynor',
                    'Edgardo Lang',
                    'Garnett Marquis',
                    'Maverick Fay',
                    'Murray Mossie Route',
                    'Demond Schimmel',
                  ],
                },
              },
            },
            // ....

You can see theese three examples in gif bellow:

Running project using Vue

Project setup

yarn install

Compiles and hot-reloads for development

yarn serve

Compiles and minifies for production

yarn build

Run your unit tests

yarn test:unit

Lints and fixes files

yarn lint

Full example result