svg-camera-icon

FontAwesome's SVG camera as a module

Usage no npm install needed!

<script type="module">
  import svgCameraIcon from 'https://cdn.skypack.dev/svg-camera-icon';
</script>

README

svg-camera-icon

stable

FontAwesome's camera icons as a module, exporting the SVG <path> data.

This is useful for quick tests with svg-mesh-3d, normalize-svg-path, and various other modules.

Install

npm install svg-camera-icon --save

Example

The default export is an SVG path string. It can be fed into modules like svg-mesh-3d and parse-svg-path.

var svgMesh3d = require('svg-mesh-3d')

var icon = require('svg-camera-icon')
console.log(icon)
//=> "M896 672q119 0 203.5 84.5t84.5 203..."

var mesh = svgMesh3d(icon, { simplify: 0.5 })
console.log(mesh)
//=> { positions: [ [x, y, z], ... ], cells: [ [a, b, c] ] }

See test.js for a rendering example.

Grabbing the SVG file in Node:

var file = require.resolve('svg-camera-icon/camera.svg')
var svg = fs.readFileSync(file, 'utf8')

retro

You can require('svg-camera-icon/retro') for an alternative retro version.

License

MIT, see LICENSE.md for details.