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

node-point

v1.1.4

Published

A JavaScript/TypeScript library for handling Point geometry according to OGC (Open Geospatial Consortium) standards.

Readme

node-point

A JavaScript/TypeScript library for handling Point geometry according to OGC (Open Geospatial Consortium) standards.

Features

  • Create and manipulate Point geometries
  • Support for WKT (Well-Known Text) format
  • Geometric transformations including translation, scaling, and rotation
  • Matrix-based transformations
  • TypeScript support with full type definitions

Installation

npm install node-point

Usage

Basic Usage

import { Point, create, clone } from 'node-point';

// Create a new Point
const point = create();
point.coordinates = [-100, 40];

// Clone a point
const clonedPoint = clone(point);

Working with WKT

import { Point, fromWKT } from 'node-point';

// Create point from WKT format
const point = new Point();
fromWKT(point, "POINT(116.36 39.90)");
console.log(point.coordinates); // [116.36, 39.9]

Geometric Transformations

import { Point, translate, scale, rotate, transformMat3 } from 'node-point';

const point = new Point();
point.coordinates = [10, 10];

// Translation
translate(point, point, [5, 5]); // Moves point to [15, 15]

// Scaling
scale(point, point, [2, 2], [0, 0]); // Scales by factor of 2 around origin

// Rotation
rotate(point, point, Math.PI / 2, [0, 0]); // Rotates 90 degrees around origin

// Matrix transformation
const matrix = new Float32Array([1, 0, 0, 0, 1, 0, 10, 20, 1]);
transformMat3(point, point, matrix); // Applies transformation matrix

API Reference

Point Class

The main Point class representing a point geometry with the following properties:

  • type: String - Always 'Point'
  • coordinates: Array - [x, y] coordinates

Functions

create(): Point

Creates a new empty Point object.

clone(a: Point): Point

Clones a Point object.

fromWKT(out: Point, wkt: string): void

Parses a Point from WKT format string (e.g., "POINT(116.36 39.90)").

transformMat3(out: Point, a: Point, mat3: Float32Array): Point

Transforms a Point using a 3x3 matrix transformation.

translate(out: Point, a: Point, dxdy: number[]): Point

Translates a Point by dx and dy distances provided as an array.

scale(out: Point, a: Point, scale: number[], origin: number[] = [0, 0]): Point

Scales a Point by scale factors around an origin point.

rotate(out: Point, a: Point, rad: number, origin: number[] = [0, 0]): Point

Rotates a Point by radians around an origin point.

Data Format

Point Structure

{
  "type": "Point",
  "coordinates": [-100, 40]
}

WKT Format Support

Supports parsing POINT type WKT format:

POINT(116.36 39.90)

License

MIT