Registry / serialization / snapsvg-cjs

snapsvg-cjs

JSON →
library0.0.6jsnpmunverified

snapsvg-cjs is a CommonJS wrapper for SnapSVG (version 0.0.6), enabling seamless use with Webpack without import-loader configuration. It repackages the original AMD-formatted SnapSVG library into CommonJS format. The package has a peer dependency on eve (~0.5.1). It is a thin wrapper with slow updates; consider @snapsvg/core for modern ESM support.

npm install snapsvg-cjs
INSTALL
IMPORT
SIG · SNAPSVG-CJS
S
snapsvg-cjs
serializationjavascriptv0.0.6
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Snap
import Snap from 'snapsvg-cjs'
const Snap = require('snapsvg-cjs')
ESM import is common; CJS require also works.
default
import Snap from 'snapsvg-cjs'
import { Snap } from 'snapsvg-cjs'
Default export only; named export 'Snap' does not exist.
snap.svg (full path)
import Snap from 'snapsvg-cjs'
import Snap from 'snapsvg-cjs/dist/snap.svg'
Direct path to the bundled file is unnecessary; package entry point handles it.

Initializes SnapSVG, draws a circle, and animates its radius.

import Snap from 'snapsvg-cjs'; // Create an SVG element const s = Snap(800, 600); document.body.appendChild(s.node); // Draw a circle const circle = s.circle(150, 150, 100); circle.attr({ fill: '#f06', stroke: '#000', strokeWidth: 5 }); // Animate circle.animate({ r: 50 }, 1000); // Access the SVG node console.log(s.node);
Debug
Known issues
gotchaDefault export only; named import { Snap } will be undefined.
fix
Use default import: import Snap from 'snapsvg-cjs'
affects: >=0.0.1
deprecatedPackage is unmaintained; consider @snapsvg/core for updates.
fix
Migrate to @snapsvg/core (ESM) or snapsvg-client (CJS)
affects: *
gotchaPeer dependency eve@~0.5.1 must be installed manually.
fix
Run: npm install eve@~0.5.1
affects: *
Errors
Common errors & fixes
Module not found: Can't resolve 'snapsvg-cjs'
Package not installed or missing in node_modules.
fix
npm install snapsvg-cjs eve@~0.5.1
Uncaught TypeError: Snap is not a constructor
Named import instead of default import.
fix
Use: import Snap from 'snapsvg-cjs'
Error: Cannot find module 'eve'
Missing peer dependency eve.
fix
npm install eve@~0.5.1
Upgrade
Version history
0.0.6latest on npm
Audit
Dependencies
everequiredPeer dependency required by SnapSVG for event handling
Agent activity
9 hits · last 30 days
node
6
OpenAI (training)
1
Resources
snapsvg-cjs — npm install snapsvg-cjs · libregistry