MCPcopy Create free account
hub / github.com/react/create-react-app / getTemporaryDirectory

Function getTemporaryDirectory

packages/create-react-app/createReactApp.js:644–666  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

642}
643
644function getTemporaryDirectory() {
645 return new Promise((resolve, reject) => {
646 // Unsafe cleanup lets us recursively delete the directory if it contains
647 // contents; by default it only allows removal if it's empty
648 tmp.dir({ unsafeCleanup: true }, (err, tmpdir, callback) => {
649 if (err) {
650 reject(err);
651 } else {
652 resolve({
653 tmpdir: tmpdir,
654 cleanup: () => {
655 try {
656 callback();
657 } catch (ignored) {
658 // Callback might throw and fail, since it's a temp directory the
659 // OS will clean it up eventually...
660 }
661 },
662 });
663 }
664 });
665 });
666}
667
668function extractStream(stream, dest) {
669 return new Promise((resolve, reject) => {

Callers 1

getPackageInfoFunction · 0.85

Calls 2

rejectFunction · 0.50
resolveFunction · 0.50

Tested by

no test coverage detected