How to use the bower-config.create function in bower-config

To help you get started, we’ve selected a few bower-config 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 bower / bower / lib / config.js View on Github external
function readCachedConfig(cwd, overwrites) {
    current = bowerConfig.create(cwd).load(overwrites);

    var config = current.toObject();

    var configstore = new Configstore('bower-github').all;

    object.mixIn(config, configstore);

    // If interactive is auto (null), guess its value
    if (config.interactive == null) {
        config.interactive =
            process.bin === 'bower' && tty.isatty(1) && !process.env.CI;
    }

    // Merge common CLI options into the config
    if (process.bin === 'bower') {
        var cli = require('./util/cli');
github mgol / check-dependencies / lib / check-dependencies.js View on Github external
options.packageDir = options.packageDir || findup(packageJsonName);
    if (!options.packageDir) {
        return missingPackageJson();
    }
    options.packageDir = path.resolve(
        options.packageDir.replace(packageJsonRegex, ''),
    );

    packageJson = `${options.packageDir}/${packageJsonName}`;
    if (!fs.existsSync(packageJson)) {
        return missingPackageJson();
    }
    packageJson = require(packageJson);

    if (options.packageManager === 'bower') {
        const bowerConfig = require('bower-config')
            .create(options.packageDir)
            .load();
        depsDirName = bowerConfig._config.directory;
    }

    // Bower uses a different name (with a dot) for package data of dependencies.
    const depsJsonName =
        options.packageManager === 'npm' ? 'package.json' : '.bower.json';

    if (options.packageManager === 'bower') {
        // Allow a local bower.
        pkgManagerPath = findup('node_modules/bower/bin/bower');
    }

    const depsDir = `${options.packageDir}/${depsDirName}`;
github Backbase / bb-cli / lib / parseCollection.js View on Github external
module.exports = function(startPath, exclude, aut, jxo) {
    startPath = path.resolve(startPath);
    auto = aut;
    jxon = jxo;
    var bowerDir = BowerConfig.create(startPath).load().toObject().directory;
    var mainPath = path.resolve(startPath, bowerDir);

    return getDir(mainPath, exclude)
    .then(readModelXmls)
    .then(reorder);

};

bower-config

The Bower config reader and writer.

MIT
Latest version published 5 years ago

Package Health Score

74 / 100
Full package analysis

Similar packages