{"name":"filename-reserved-regex","version":"4.0.0","keywords":["regex","regexp","filename","reserved","illegal"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"filename-reserved-regex@4.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/filename-reserved-regex#readme","bugs":{"url":"https://github.com/sindresorhus/filename-reserved-regex/issues"},"dist":{"shasum":"bc981c1e5c8aee7d32ac8594c109aa14682b01d2","tarball":"http://registry-npm.ywwl.com/filename-reserved-regex/download/filename-reserved-regex-4.0.0.tgz","fileCount":4,"integrity":"sha512-9ZT504KxEQDamsOogZImAWGEN24R1uFAxU3ZS4AZqn2ooidmN68Olh7n4/RcA4lLatZztjA0ZSuxeLHVoCc8JA==","signatures":[{"sig":"MEUCIQDm4HJQ6PRkPNV+dBH7xfBpLovmzkshdTBQDmfkFCMo9AIgAOsdyg27fr3BF0HYnGWPp7FWZbniRgIIu0Q5MPr7cc8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3239,"size":1780,"noattachment":false,"key":"/filename-reserved-regex/-/filename-reserved-regex-4.0.0.tgz"},"type":"module","engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"1403e86e937f0955fbb0ffad4ce56fbae47e3cc0","scripts":{"test":"xo && ava"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/filename-reserved-regex.git","type":"git"},"_npmVersion":"10.9.2","description":"Regular expression for matching reserved filename characters","directories":{},"sideEffects":false,"_nodeVersion":"20.19.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.2","ava":"^6.4.1"},"_npmOperationalInternal":{"tmp":"tmp/filename-reserved-regex_4.0.0_1757887535057_0.9073074170092075","host":"s3://npm-registry-packages-npm-production"},"readme":"# filename-reserved-regex\n\n> Regular expression for matching reserved filename characters\n\nOn Unix-like systems `/` is reserved and [`<>:\"/\\|?*`](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) as well as non-printable characters `\\u0000-\\u001F` on Windows. Windows also doesn't allow names ending in space or period.\n\n## Install\n\n```sh\nnpm install filename-reserved-regex\n```\n\n## Usage\n\n```js\nimport filenameReservedRegex, {windowsReservedNameRegex} from 'filename-reserved-regex';\n\nfilenameReservedRegex().test('foo/bar');\n//=> true\n\nfilenameReservedRegex().test('foo-bar');\n//=> false\n\n'foo/bar'.replace(filenameReservedRegex(), '!');\n//=> 'foo!bar'\n\nwindowsReservedNameRegex().test('aux');\n//=> true\n```\n\n## API\n\n### filenameReservedRegex()\n\nReturns a regex that matches all invalid characters.\n\n### windowsReservedNameRegex()\n\nReturns an exact-match case-insensitive regex that matches reserved Windows device names.\n\nThese include `CON`, `PRN`, `AUX`, `NUL`, `CONIN$`, `CONOUT$`, `COM1` through `COM9`, `COM¹`, `COM²`, `COM³`, `LPT1` through `LPT9`, `LPT¹`, `LPT²`, and `LPT³`. `COM0` and `LPT0` are conservatively matched for compatibility with previous versions.\n\nNames followed by an extension are also matched because, for example, `NUL.txt` and `NUL.tar.gz` are both equivalent to `NUL`. ASCII spaces before the extension or at the end of the name are ignored in the same way as on Windows.\n","publish_time":1757887535237,"_cnpm_publish_time":1757887535237,"dist-tags":{"latest":"4.1.0"}}