Files
DefinitelyTyped/types/parent-package-json/parent-package-json-tests.ts
2018-02-06 10:31:25 -08:00

11 lines
324 B
TypeScript

import parent = require('parent-package-json');
const hasParent = parent('/optional/path/', 1);
if (hasParent !== false) {
const pathToParent: string = hasParent.path;
const contentOfParent: string = hasParent.read();
const JSONOfParent = hasParent.parse();
const versionOfParent = JSONOfParent.version;
}