import fs from 'fs' ; import path from 'path' ; param subPath export function resolveOffChainModulesPath ( ... subPath ) { return path . join ( lookupPackageJsonFolder ( __dirname ) , '../..' , ... subPath ) ; } export function lookupPackageJsonFolder ( fromPath ) { if ( ! fromPath ) throw new Error ( 'Cannot find a package.json' ) ; const foundPackageJson = fs . readdirSync ( fromPath ) . some ( ( name ) => name === 'package.json' ) ; if ( foundPackageJson ) return fromPath ; return lookupPackageJsonFolder ( path . join ( fromPath , '..' ) ) ; } deprecated export function pathOfRootConfig ( ) { return resolveOffChainModulesPath ( './config.json' ) ; }