vankizmann / pico-js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pico-ui


A JS heleper library. Docs following soon

Installation

npm install @kizmann/pico-js [or] yarn add @kizmann/pico-js

Dependencies

This package is dependent of moment (Right now its required but will be optional or ditched soon).

CDN Usage

<script src="//unpkg.com/@kizmann/pico-js@latest/dist/pico-js.js"></script>
pi.Dom.ready(function () {
    console.log('Yeah :clap:');
});

Module Usage

import { Dom } from "@kizmann/pico-js";
Dom.ready(function () {
    console.log('Yeah :metal:');
});

Included utilities

Included libraries

ES5/6 Precompile

Incase you are not using the babel plugins (ES6) used in babel.config.js you will encounter errors while compiling. To prevent that its required to add an alias to your webpack.config.js.

webpack.config.js

module.exports = {
    resolve: {
        alias: {
            '@kizmann/pico-js': '@kizmann/pico-js/dist/pico-js.js'
        }
    }
}

webpack.mix.js

mix.webpackConfig({
    resolve: {
        alias: {
            '@kizmann/pico-js': '@kizmann/pico-js/dist/pico-js.js'
        }
    }
});

Visual Studio Code Autocomplete

When using VS Code with the ES5 fix from above you need to create or add to your existsing jsconfig.json this alias to enable correct autocomplete.

jsconfig.json

{
  "compilerOptions": {
    "paths": {
      "@kizmann/pico-js": ["node_modules/@kizmann/pico-js/src/index.js"]
    }
  }
}

About


Languages

Language:JavaScript 100.0%