How to use the cssom/package.json.version function in cssom

To help you get started, we’ve selected a few cssom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fkling / astexplorer / website / src / parsers / css / cssom.js View on Github external
import defaultParserInterface from '../utils/defaultParserInterface';
import pkg from 'cssom/package.json';

const ID = 'cssom';

export default {
  ...defaultParserInterface,

  id: ID,
  displayName: ID,
  version: pkg.version,
  homepage: pkg.homepage || 'https://github.com/NV/CSSOM',
  locationProps: new Set(['__starts', '__ends']),
  typeProps: new Set(),

  loadParser(callback) {
    require(['cssom/lib/parse'], callback);
  },

  parse(CSSOM, code) {
    return CSSOM.parse(code);
  },

  getNodeName(node) {
    return node.constructor.name;
  },