
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A procedural 2D map generator based on Perlin / simplex noise

Create a Canvas in your HTML code:
<canvas id="map-canvas" width="800" height="400"></canvas>
Create a HeightMap with the MapGenerator in your JS code:
var NoiseMap = require('noise-map');
var generator = new NoiseMap.MapGenerator();
var heightmap = generator.createMap(400, 200, {type: 'perlin'});
var context = document.getElementById('map-canvas').getContext('2d');
heightmap.draw(context, 800, 400, NoiseMap.STYLE.GRAY);
This module allows you to create random heightmaps with Perlin and simplex noise, edit their data with utility methods, and display them on a Canvas.
The module exposes four items:
MapGenerator: A configurable map constructorHeightMap: A data container for noise valuesSTYLE: An enum for the map rendering styleColorizer: An internal map rendering toolnew MapGenerator(seed = random(), configuration = {})Instantiate a new MapGenerator, that can be used repeatedly to create different maps. You usually need only one MapGenerator.
Arguments:
seed: optionnal, an integer used a a seed for the noise functions
configuration: optionnal, an object describing the current configuration of this generator:
"simplex" or "perlin")1)0.5)0.5)0.5)false)setSeed(seed)setConfig(config)newMap(width, height, config = {})Return a new HeightMap with the input dimensions, and fill it wil random values in [0, 1];
new HeightMap(width, height, data = [])Create a new HeightMap with dimensions (width, height).
The argument data is an optionnal 1D Array containing the values of the heightmap.
get(x, y)Get the value at (x, y)
set(x, y, value)Set the value at (x, y) to value
scaleValues(coef)Exponentially scale the values of the heightmap, by a coefficient coef;
stepValues(n)Floor the values of the heightmap, resulting in n steps;
inverseValues()Inverse the values of the heightmap
draw(context, outputWidth, outputHeight, style = STYLE.GRAY, enableShadow = false)Canvas elementThe style can be one of: STYLE.GRAY, STYLE.REALISTIC, STYLE.GEOLOGIC, STYLE.HEATMAP
You can install the module with npm:
npm install noise-map
You can import the module with unpkg:
<script type="text/javascript" src="https://unpkg.com/noise-map@latest"></script>
You can clone the repository & include the noise-map.js file in your project:
git clone https://github.com/ogus/noise-map.git
This project is licensed under the WTFPL - see LICENSE for more details
FAQs
A procedural 2D map generator based on Perlin / simplex noise
The npm package noise-map receives a total of 9 weekly downloads. As such, noise-map popularity was classified as not popular.
We found that noise-map demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.