hunk.code_window: declare module 'write-json-file' {
     const anything: any;
     export = anything;
   }
   declare module 'mem' {
     const anything: any;
     export = anything;
   }
  
hunk.labels: keep keep keep keep add keep keep keep keep
hunk.after_edit: declare module 'write-file-atomic' {
     const anything: any;
     export = anything;
   }
  
hunk.file_path: typings/local.d.ts
hunk.type: add
file: import path = require('path')
  import {Package} from '../types'
  import readPkg from './readPkg'
  
  export default async function safeReadPkg (pkgPath: string): Promise<Package | null> {
    try {
      return await readPkg(pkgPath)
    } catch (err) {
      if ((<NodeJS.ErrnoException>err).code !== 'ENOENT') throw err
      return null
    }
  }
  
  export function fromDir (pkgPath: string): Promise<Package | null> {
    return safeReadPkg(path.join(pkgPath, 'package.json'))
  }
  