specificity 405 B

123456789101112131415
  1. #!/usr/bin/env node
  2. // CLI uses CommonJS require to support older versions of Node.js
  3. var specificity = require('../dist/specificity'),
  4. selector = process.argv[2],
  5. result;
  6. if (selector) {
  7. result = specificity.calculate(selector)[0];
  8. console.log(result.specificity);
  9. } else {
  10. console.log('Usage: specificity <selector>');
  11. console.log('Computes specificity of a CSS selector.');
  12. process.exit(1);
  13. }