Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 625 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 625 Bytes

copy-package

Allows you to download and copy files from a npm package from a temporary installation into your current directory.

import { copyPackageToTempDir } from 'copy-package';

try {
  let tmp = copyPackageToTempDir('expo-template-bare-minimum');

  // tmp.name gives you the path, do what you want with it!

  // call this to clean up
  tmp.removeCallback();
} catch(e) {
  // uh oh
}
$ npx copy-package expo-template-bare-minimum
$ cd expo-template-bare-minimum

Attribution

The approach used to do this is copied from the wonderful patch-package.