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

@wintercms/snowboard

v0.6.2

Published

The Winter CMS Snowboard.js framework as a standalone module

Downloads

34

Readme

Snowboard.js Base

Standalone version of the Winter CMS JavaScript framework that provides a simple yet powerful system for organising and controlling your frontend functionality. The main aims of the framework are to provide a familiar development experience for people using the Winter or Laravel PHP frameworks to develop functionality for their frontend interfaces.

Features

  • Structured development experience using ES6 classes, with support for abstract classes, traits and extensions.
  • Flexible plugin architecture with support for reusable plugins and singletons.
  • Simple state and events management, operating across the entire app.
  • Lightweight, only ~51kb minified, with minimal dependencies.
  • Can be used directly with a <script> tag or through a build process (Webpack, Rollup, Laravel Mix, etc.).

Installation

Via a script tag

This framework can be included directly in your app through a <script> tag. Download the latest release in the Assets tab and place it somewhere web-accessible, then include it in your page (generally just above the closing </body> tag).

<script src="https://my.app.com/snowboard.min.js"></script>

This will autoload the Snowboard framework and make it available globally via the Snowboard variable. This allows you to add any plugins or extended functionality by simply loading in some JavaScript after the Snowboard script tag.

<script>
Snowboard.addPlugin('myPlugin', MyPlugin);
Snowboard.on('ready', () => {
    console.log('Snowboard is ready to go!');
});
</script>

Via ES6 import

If you are using a build process such as Webpack, Rollup, Laravel Mix, etc, you can also set up your app to import Snowboard and create an app ready for use.

Your project must be enabled with NPM, (ie. it should have a package.json file), then you can simply include Snowboard as a dependency:

npm i -S @wintercms/snowboard

Then, in your entrypoint script, create the application:

import { Snowboard } from '@wintercms/snowboard';
import MyPlugin from './plugins/MyPlugin';

const app = new Snowboard();
app.addPlugin('myPlugin', MyPlugin);
app.on('ready', () => {
    console.log('Snowboard is ready to go!');
});

export default app;

Documentation

Please see the Snowboard documentation on Winter CMS.

What's included

By default, the Base Snowboard package comes included with the following:

Abstracts

  • PluginBase - The base class used for all Snowboard plugins.
  • Singleton - The base class used for all Snowboard singletons.

Traits

  • Configurable - Allows a plugin to derive configuration from data attributes and get and set configuration on the fly.
  • FiresEvents - Provides the plugin with the ability to fire local and global JavaScript events, and allows outside functionality to listen to events on the plugin instance.

Utilities

  • AssetLoader - Allows the loading of CSS, JavaScript and image assets on the fly.
  • Cookie - Provides a thin wrapper around the JS Cookie library to allow management of cookies.
  • JsonParser - Provides a looser implementation of JSON, based off the JSON5 library that accounts for many human errors with writing compliant JSON.
  • Sanitizer - Provides sanitization of HTML documents and elements for common XSS vulnerabilities.
  • Url - Provides URL handling.

More information

For more information on development and usage of this framework and available packages, please see the main repository: https://github.com/wintercms/snowboard.js

Security vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

This framework is licensed under the MIT license.