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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@7syllable/photon-core

v0.18.1

Published

Photon is a modern JavaScript library for creating and sharing modular line drawings for CNC and laser cutters. Resurrected from Microsoft's Maker.js.

Readme

Photon

Your compass and straightedge, in JavaScript.

Create line drawings using familiar constructs from geometry and drafting. Initially designated for CNC and laser cutters, Photon can also help you programmatically draw shapes for any purpose. It runs in both Node.js and web browsers.

2D Export formats: DXF, SVG, PDF, Jscad CAG object

3D Export formats: Jscad Script, Jscad CSG object, STL

Demos - Documentation

Sample animation

Origins

Photon is a modern continuation of Microsoft's Maker.js project. When Microsoft archived the original Maker.js repository, we forked it to ensure this valuable tool continues to evolve and serve the maker community.

Original Project: Microsoft Maker.js (archived)
License: Apache 2.0
Original Author: Dan Marshall / Microsoft Corporation

We're grateful to Microsoft and the original contributors for creating and open-sourcing this excellent library. Photon maintains full backward compatibility while adding modern features and active maintenance.

Core concepts

  • paths - The primitive elements of a drawing are lines, arcs, and circles.
  • models - Groups of paths to compose a shape.
  • layers - Organization of models, such as by color or tool type.
  • chains - A series of lines and arcs that connect end-to-end continuously.

Learn more in the tutorial or API documentation.

Features

Built-in models

Import formats

Getting Started

Installation

Install Photon via npm:

npm install @photon/core

Usage in Node.js

In ESM code (recommended):

import * as photon from '@photon/core';

// Create a simple rectangle
const rect = new photon.models.Rectangle(100, 50);

// Export to SVG
const svg = photon.exporter.toSVG(rect);

In CommonJS code:

const photon = require('@photon/core');

// Create a simple rectangle
const rect = new photon.models.Rectangle(100, 50);

Usage in Web Browser

Use the ES module build (recommended):

<script type="module">
  import * as photon from "https://cdn.jsdelivr.net/npm/@photon/core@latest/dist/photon.es.js";
  
  // Create a simple star
  const star = new photon.models.Star(5, 50, 25);
  const svg = photon.exporter.toSVG(star);
  document.body.innerHTML = svg;
</script>

Or use the UMD bundle for a global Photon variable:

<script src="https://cdn.jsdelivr.net/npm/@photon/core@latest/dist/photon.umd.js"></script>
<script>
  const { models, paths, exporter } = window.Photon;
  const circle = new models.Circle([0, 0], 50);
</script>

CDN Links

  • ES module: https://cdn.jsdelivr.net/npm/@photon/core@latest/dist/photon.es.js
  • UMD global: https://cdn.jsdelivr.net/npm/@photon/core@latest/dist/photon.umd.js

Optional dependencies:

<!-- Bezier support (required for BezierCurve model) -->
<script src="https://cdn.jsdelivr.net/npm/bezier-js@2/bezier.js"></script>

<!-- Font support for Text model -->
<script src="https://cdn.jsdelivr.net/npm/opentype.js@0/dist/opentype.js"></script>

Try it now

Visit the Photon Playground to edit and run JavaScript from your browser.

Each of the demos will also open in the playground so that you can explore and modify their code.

Migrating from Maker.js

Photon maintains API compatibility with Maker.js. To migrate:

  1. Update package name:

    npm uninstall makerjs
    npm install @photon/core
  2. Update imports:

    // Old (Maker.js)
    import * as makerjs from 'makerjs';
       
    // New (Photon)
    import * as photon from '@photon/core';
  3. Update variable names (optional but recommended):

    // Old
    const rect = new makerjs.models.Rectangle(100, 50);
    const svg = makerjs.exporter.toSVG(rect);
       
    // New
    const rect = new photon.models.Rectangle(100, 50);
    const svg = photon.exporter.toSVG(rect);
  4. Update global namespace (if using UMD/browser builds):

    • Old: window.MakerJs or window.makerjs
    • New: window.Photon

All APIs, models, and functionality remain the same. The core library is fully compatible.

Contributing

There are many ways to contribute to Photon:

See CONTRIBUTING.md for guidelines.

Credits

Photon depends on:


Original Project: Maker.js was a Microsoft Garage project. We're grateful to Microsoft and Dan Marshall for creating and open-sourcing this excellent library under the Apache 2.0 license.