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 🙏

© 2025 – Pkg Stats / Ryan Hefner

visvalingam-simplifier

v0.1.5

Published

An implementation of visvalingam's line simplification algorithm.

Readme

Visvalingam’s Line Simplification Algorithm

My implementations of Visvalingam's line simplification algorithm in JS and C♯.

There's a demo (development demo) available if you'd like to try it out before installing it and using it in your project :smiley_cat:

Install

Installing this npm package is easy. Make sure you've got npm, and then simply run:

npm install --save visvalingam-simplifier

Usage

This package is written as an ES6 module, so it should work on any platform that supports it. Make sure you have the npm package installed (see above). Then you can use it like so:

import { simplify_line } from "visvalingam-simplifier";

let points_simple = simplify_line([
    { x:389, y: 361 },
    { x:445, y: 239 },
    { x:461, y: 228 },
    { x:501, y: 208 },
    { x:556, y: 195 },
    { x:603, y: 209 },
    { x:678, y: 262 },
    { x:735, y: 279 },
    { x:795, y: 263 },
    { x:838, y: 222 },
    { x:861, y: 172 }
], 6);

The above will work if you're using a preprocessor such as browserify, webpack, or babel - but it might not work so well if you're using pure Node.JS or in the browser without any of the aforementioned preprocessors. In those cases, you may need to tweak the import statement a bit:

For Node.js:

const simplify_line = require("visvalingam-simplifier");

For the browser:

import { simplify_line } from "./node_modules/visvalingam-simplifier/simplify_line.js";

If you encounter any issues (especially relating to importing / requiring it) - please do let me know by opening an issue! I'll be happy to help :smiley_cat:

C♯ Version

I've also ported the algorithm to C♯ for a project of mine. You can find it here: SimplifyLine.cs. It's actually a slightly modified copy of the real implementation I've done for a secret project of mine, so to that end you'll have to implement your own Vector class - or tweak it to use the Vector2 class I wrote a while ago.

Contribute

Found a bug? Experiencing difficulties? Please open an issue! Pull requests are accepted too - so if you've got an improvement / bug fix, I'll glading merge :smiley_cat:

Links

I found the follwing links useful when implementing this module:

  • https://bost.ocks.org/mike/simplify/

License

This package is licensed under the Mozilla Public License 2.0. The full license text is available here - along with a summary by GitHub on what you can and can't so with it.

If you'd like to do something that's prohibited by the license - please do get in touch! My email address / contact details are available on my GitLab or GitHub profiles.