{"id":20559,"library":"snapsvg-cjs","title":"snapsvg-cjs","description":"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.","status":"active","version":"0.0.6","language":"javascript","source_language":"en","source_url":"https://github.com/geelen/Snap.svg-cjs","tags":["javascript","snapsvg","svg","webpack"],"install":[{"cmd":"npm install snapsvg-cjs","lang":"bash","label":"npm"},{"cmd":"yarn add snapsvg-cjs","lang":"bash","label":"yarn"},{"cmd":"pnpm add snapsvg-cjs","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required by SnapSVG for event handling","package":"eve","optional":false}],"imports":[{"note":"ESM import is common; CJS require also works.","wrong":"const Snap = require('snapsvg-cjs')","symbol":"Snap","correct":"import Snap from 'snapsvg-cjs'"},{"note":"Default export only; named export 'Snap' does not exist.","wrong":"import { Snap } from 'snapsvg-cjs'","symbol":"default","correct":"import Snap from 'snapsvg-cjs'"},{"note":"Direct path to the bundled file is unnecessary; package entry point handles it.","wrong":"import Snap from 'snapsvg-cjs/dist/snap.svg'","symbol":"snap.svg (full path)","correct":"import Snap from 'snapsvg-cjs'"}],"quickstart":{"code":"import Snap from 'snapsvg-cjs';\n\n// Create an SVG element\nconst s = Snap(800, 600);\ndocument.body.appendChild(s.node);\n\n// Draw a circle\nconst circle = s.circle(150, 150, 100);\ncircle.attr({\n  fill: '#f06',\n  stroke: '#000',\n  strokeWidth: 5\n});\n\n// Animate\ncircle.animate({ r: 50 }, 1000);\n\n// Access the SVG node\nconsole.log(s.node);","lang":"typescript","description":"Initializes SnapSVG, draws a circle, and animates its radius."},"warnings":[{"fix":"Use default import: import Snap from 'snapsvg-cjs'","message":"Default export only; named import { Snap } will be undefined.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Migrate to @snapsvg/core (ESM) or snapsvg-client (CJS)","message":"Package is unmaintained; consider @snapsvg/core for updates.","severity":"deprecated","affected_versions":"*"},{"fix":"Run: npm install eve@~0.5.1","message":"Peer dependency eve@~0.5.1 must be installed manually.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install snapsvg-cjs eve@~0.5.1","cause":"Package not installed or missing in node_modules.","error":"Module not found: Can't resolve 'snapsvg-cjs'"},{"fix":"Use: import Snap from 'snapsvg-cjs'","cause":"Named import instead of default import.","error":"Uncaught TypeError: Snap is not a constructor"},{"fix":"npm install eve@~0.5.1","cause":"Missing peer dependency eve.","error":"Error: Cannot find module 'eve'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}