How to use the import-from.bind function in import-from

To help you get started, we’ve selected a few import-from 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 conventional-changelog / commitlint / source / library / get-preset.js View on Github external
import importFrom from 'import-from';

const cwd = importFrom.bind(null, process.cwd());

export default (name, require = cwd) => {
	return require(`conventional-changelog-${name}`);
};
github conventional-changelog / commitlint / @commitlint / core / src / library / get-preset.js View on Github external
import importFrom from 'import-from';

const cwd = importFrom.bind(null, process.cwd());

export default (name, require = cwd) => {
	return require(`conventional-changelog-${name}`);
};

import-from

Import a module like with `require()` but from a given path

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis

Popular import-from functions