UNPKG

fs-extra

Version:

fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.

12 lines (11 loc) 263 B
/* eslint-disable node/no-deprecated-api */ module.exports = function (size) { if (typeof Buffer.allocUnsafe === 'function') { try { return Buffer.allocUnsafe(size) } catch (e) { return new Buffer(size) } } return new Buffer(size) }