How to use the resolve-package-path.getRealFilePath function in resolve-package-path

To help you get started, we’ve selected a few resolve-package-path 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 ember-cli / ember-cli / lib / models / package-info-cache / index.js View on Github external
/*
 * Performance cache for information about packages (projects/addons/"apps"/modules)
 * under an initial root directory and resolving addon/dependency links to other packages.
 */

const fs = require('fs-extra');
const path = require('path');
const ErrorList = require('./error-list');
const Errors = require('./errors');
const PackageInfo = require('./package-info');
const NodeModulesList = require('./node-modules-list');
const logger = require('heimdalljs-logger')('ember-cli:package-info-cache');
const resolvePackagePath = require('resolve-package-path');

const getRealFilePath = resolvePackagePath.getRealFilePath;
const getRealDirectoryPath = resolvePackagePath.getRealDirectoryPath;
const _resetCache = resolvePackagePath._resetCache;

const PACKAGE_JSON = 'package.json';

/**
 * Class that stores entries that are either PackageInfo or NodeModulesList objects.
 * The entries are stored in a map keyed by real directory path.
 *
 * @public
 * @class PackageInfoCache
 */
class PackageInfoCache {
  constructor(ui) {
    this.ui = ui; // a console-ui instance
    this._clear();

resolve-package-path

a special purpose fast memoizing way to resolve a node modules package.json

MIT
Latest version published 3 years ago

Package Health Score

68 / 100
Full package analysis

Similar packages