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

@fjbo-net/coderain

v1.0.0

Published

A Matrix-inspired code rain animation distributed via NPM.

Downloads

2

Readme

CodeRain

A Matrix-inspired code rain animation distributed via NPM.

But, what does that actually mean?

CodeRain is a customizable Matrix-style code rain animation that executes in real-time, virtually running on any device that supports a web browser. More specifically, it's a JavaScript object that renders a Matrix-style code rain in a <canvas> element at the front-end. It's easy to integrate, deploy, customize and use.

Features

  • Vanilla JavaScript: written in pure native JavaScript.
  • Unobtrusive: Fully compatible with any libraries or frameworks.
  • Easy to customize: At instantiation or after. Customize on-the-fly.
  • Simple initialization: Simply instantiate and that's it!
  • Responsive: No hard-set values, so it completely adapts to your vision. Seamlessly.
  • Package-manager-based distribution: Easy to install, track, update, and redistribute.
  • Lightweight: Since it's an environment-free pure JavaScript implementation, it has no additives, conservatives, MSGs, sweeteners or gluten.

How to Use

CodeRain is easy to use and it's super flexible to adapt to your development workflow due to the multiple options for setting up CodeRain:

  • Via NPM: Usually used for an integrated build process, usually for simplifying and/or minifying assets handled by a task manager (like Gulp or Grunt).
  • Self-Hosted: Usually used for serving an application or website from a single server or for an easier set-up.
  • UNPKG (CDN): Usually used for decentralizing asset distribution or hosting, to improve network performance.

Setting Up: via NPM

It's easy to add CodeRain into your existing project with NPM. Just follow the steps below:

  1. Install via NPM

    npm install @fjbo-net/coderain --save-dev
  2. Add to your project: A couple of standard options are:

    • Add it to your build tasks to be prepended to the resulting application/website JavaScript build.
    • (or) Set your build tasks to copy one of the bundled files from the /node_modules/@fjbo-net/coderain/ directory in your project to your project's distributable destination.

    But, of course, you can follow your own build and distribution practices.

  3. Layout the markup. All it's required in the HTML side of things is: 1. A reference to the JavaScript file containing CodeRain (a <script> tag). 2. A <canvas> element (or multiple elements) with a unique identifier (each).

  4. Initialize CodeRain. Just remember to make sure to instantiate CodeRain once your markup has been loaded in the client.

Setting Up: Self-Hosted

If downloading a build into your projects it's what works best for you, all you need to do is:

  1. Download the version that works best for you (see Choosing a Build for more details) from: https://www.npmjs.com/package/@fjbo-net/coderain?activeTab=explore
  2. Copy your preferred JavaScript file into your project's distributable JavaScript folder.
  3. Layout the markup. All it's required in the HTML side of things is: 1. A reference to the JavaScript file containing CodeRain (a <script> tag). 2. A <canvas> element (or multiple elements) with a unique identifier (each).
  4. Initialize CodeRain. Just remember to make sure to instantiate CodeRain once your markup has been loaded in the client.

Setting Up: via UNPKG (CDN)

CodeRain does not have a dedicated CDN for serving builds. However, you can use UNPKG to request a build.

  1. Select a build. See Choosing a Build for more details.
  2. Layout the markup: All it's required in the HTML side of things is: 1. A reference to an UNPKG endpoint (a <script> tag). 2. A <canvas> element (or multiple elements) with a unique identifier (each). For your convenience, here's a markup sample:
    <!doctype html>
    <html lang="en">
    	<head>
    		<meta charset="utf-8" />
    
    		<!-- CodeRain via UNPKG-->
    		<script
    			type="javascript"
    			src="https://unpkg.com/@fjbo-net/coderain">
    		</script>
    
    		<!-- Your JavaScript -->
    		<script
    			type="javascript"
    			src="./js/main.js">
    		</script>
    	</head>
    	<body>
    		<canvas id="coderain"></canvas>
    	</body>
    	<!-- Your procedural (or post-render) JavaScript -->
    	<script
    		type="javascript"
    		src="./js/post-load.js">
    	</script>
    </html>
  3. Initialize CodeRain. Just remember to make sure to instantiate CodeRain once your markup has been loaded in the client.

Configuring CodeRain

You can customize CodeRain at initialization via an optional configuration object when instantiating CodeRain. The default configuration is the following:

let
// Init with the default configuration (implicit)
defaultCodeRain = new CodeRain(),
// Init with the default configuration (explicit)
expandedDefaultCodeRain = new CodeRain({
				fontFamily: `monospace`,
				fontSize: 18,
				// color sets the font color as defined by an RGB value.
				color: {
					r: 0,
					g: 255,
					b: 50
				},
				// background sets the background color as defined by an RGBA value.
				background: {
					r: 0,
					g: 0,
					b: 0,
					a: 1
				},
				//
				elementId: 'custom-coderain'
			});

About

Author

FJBO | Francisco Javier Becerra-Ortiz

License

Copyright © 2021, FJBO. Released under the CC BY-NC-SA 4.0 license.