@js-utils-kit/fs@2.0.0
·
71 commits
to main
since this release
Major Changes
-
#174
004efdbThanks @teneplaysofficial! - Improve and Relocate CommonJS DetectionThe previous
hasCommonJSFilenameutility has been removed from@js-utils-kit/fsand replaced with a more robustisCommonJShelper in@js-utils-kit/env. Unlike the old implementation, which only checked for__filename, the new version uses multiple runtime signals (module.exports,require,exports,__filename, and__dirname) to provide a more reliable indication of a CommonJS environment. Update your imports to useisCommonJSfrom@js-utils-kit/env.- import { hasCommonJSFilename } from '@js-utils-kit/fs'; + import { isCommonJS } from '@js-utils-kit/env'; - if (hasCommonJSFilename) { + if (isCommonJS) { console.log('Running in CommonJS environment'); } else { console.log('Running in ESM environment'); }