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

fastnoise-lite

v1.1.1

Published

FastNoise Lite is an extremely portable open source noise generation library with a large selection of noise algorithms

Downloads

273

Readme

npmGitHub

FastNoise Lite

FastNoise Lite is an extremely portable open source noise generation library with a large selection of noise algorithms. This library focuses on high performance while avoiding platform/language specific features, allowing for easy ports to as many possible languages.

Features

  • 2D & 3D
  • OpenSimplex2 Noise
  • OpenSimplex2S Noise
  • Cellular (Voronoi) Noise
  • Perlin Noise
  • Value Noise
  • Value Cubic Noise
  • OpenSimplex2-based Domain Warp
  • Basic Grid Gradient Domain Warp
  • Multiple fractal options for all of the above

Getting Started

Using FastNoise Lite with npm

To begin install the npm package fastnoise-lite with

Note FastNoise Lite does not support the node.js require(''); function. Instead, enable ES6 modules and import.

import FastNoiseLite from "fastnoise-lite";

let noise = new FastNoiseLite();

Creating a 128x128 Array of OpenSimplex2 Noise

// Create and configure FastNoiseLite object
let noise = new FastNoiseLite();
noise.SetNoiseType(FastNoiseLite.NoiseType.OpenSimplex2);

// Gather noise data
let noiseData = [];

for (let x = 0; x < 128; x++) {
    noiseData[x] = [];

    for (let y = 0; y < 128; y++) {        
        noiseData[x][y] = noise.GetNoise(x,y);
    }
}

// Do something with this data...

Internal Method Overloading

Since JavaScript does not support method overloading it has been simulated to make the user experience more continuous between language versions.

Some of the code has been changed to use switch statements since it provided a minor performance boost in some small frequently used places eg the _Hash methods.

Here is a template for the method overloading:

class FastNoiseLite {
    /**
     * JSdoc
     */
    Method() {
        let R2 = (Param1, Param2) => {
            // do something 2D
        }

        let R3 = (Param1, Param2, Param3) => {
            // do something 3D
        }

        if (arguments.lenght === 2) {
            return R2(arguments[0], arguments[1]);
        }

        if (arguments.length === 3) {
            return R3(arguments[0], arguments[1], arguments[2])
        }
    }

}

DM dev_storm on discord or email w/ any questions or need any support or ask someone in our discord :D