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

@veams/core

v1.1.1

Published

Veams exposes a framework which you can use as a simple starting point and can be enhanced and extended by an easy plugin system to build your own project based framework in a simple, fast, scalable and understandable way.

Downloads

392

Readme

Core of VEAMS framework

VEAMS provides a simple but extendable frontend framework. When you have scaffolded the project with the @veams/cli, it will be automatically integrated into your project.

When you have scaffolded the project with the CLI you can skip the Installation and Usage section!

Table of Content

  1. Typical Use Cases for Veams
  2. Installation
  3. Basic Usage
  4. Advanced Usage
  5. Core
  6. Helpers
  7. Plugins
  8. Common Classes & Services

Installation without @veams/cli

To install VEAMS as framework you have to work with the core library.

NPM

npm install @veams/core --save

Yarn

yarn add @veams/core 

Usage

Basic Usage

To use VEAMS as framework just install and import the library:

JavaScript

import Veams from '@veams/core';

This imports a starter kit which initialize the core.

SCSS

// Reset (veams-reset or veams-normalize)
@import "./node_modules/veams/scss/veams-reset";
@import "./node_modules/veams/scss/veams";

That's it. The framework is integrated.

Advanced Usage

You can also create your own instance of the core by using the Core class.

import Core from '@veams/core/lib/core';

let app = new Core({
    namespace: 'App',
    addToGlobal: false
});

VEAMS Core

The core of VEAMS is nothing more than a simple object (Veams). In general VEAMS comes with some empty and predefined objects and a basic API.

Veams Core Options

  • namespace {String} ['Veams'] - Add your custom namespace.
  • addToGlobal {Boolean} [false] - Add your previously defined namespace to the global window object.

VEAMS Core API

Veams.addHelper('name', helperFunction)

  • @param {String} name - Helper name which will be used in the registration process.
  • @param {Function} helperFunction - The helper function.

The method allows the registration of provided or custom helpers.

Veams.use(plugin)

  • @param {Object} plugin - Plugin object which extends the VEAMS object.

This method provides the possibility to register a plugin, see section Creation of plugins.

Veams Core Object

Veams.EVENTS {Object}

The events object can be used to communicate between modules. It can be extended with further custom events. Just see @veams/plugin-vent.

Veams.base.version {String}

Display the current VEAMS version.

Veams.dectections {Object}

The detections object contains the current width and height, as well as if you are on a touch device or not.

The detections object will be updated when you use @veams/plugin-media-query-handler.

Veams.helpers {Object}

VEAMS has some helpers which you can use. But you should use @veams/helpers for usage.

Veams.Plugins {Object}

All named plugins will be saved in this object. In the beginning it is empty.