How to use the pkginfo function in pkginfo

To help you get started, we’ve selected a few pkginfo 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 topcoat / resin / src / bin / index.js View on Github external
#!/usr/bin/env node
/* eslint-disable no-console */
import program from 'commander';
import pkginfo from 'pkginfo';
import fs from 'fs';
import resin from '../lib/index.js';

pkginfo(module, 'version', 'description');

function list(val) {
  const result = val.replace(/(^(?:"|')?\[)|(](?:"|')?$)/g, '').split(',');
  return result.map((item) => item.trim().replace(/(^(?:"|')?)|((?:"|')?$)/g, ''));
}

program
  .description(module.exports.description)
  .usage('[options] ')
  .option('-v, --no-vars', 'Passing this flag will skip using the postcss-css-variables plugin.')
  .option('-e, --no-extend', 'Passing this flag will skip using the postcss-inherit plugin.')
  .option('-n, --namespace ', 'Namespace to use as a prefix for classes.', '')
  .option('-u, --urlprefix ', 'String to prepend to urls.', '')
  .option('-b, --browsers ', 'Browser string to pass to autoprefixer.', 'last 2 version')
  .option('-a, --no-autoprefixer', 'Passing this flag will disable autoprefixer.')
  .option('-d, --debug',
github angrykoala / yamp / app / xejs_loader.ts View on Github external
import Xejs from 'xejs';
import pkginfo from 'pkginfo';

pkginfo(module, "version");
const version = module.exports.version;

function getDate(): string {
    const date = new Date();
    const day = date.getDate();
    const month = date.getMonth() + 1;
    const year = date.getFullYear();
    return day + "/" + month + "/" + year;
}

export default class XejsLoader {
    public loadFile(file: string): Promise {
        const options = this.generateOptions();
        const loader = new Xejs(options);
        return loader.render(file);
    }

pkginfo

An easy way to expose properties on a module from a package.json

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis

Popular pkginfo functions