{"_id":"filename-reserved-regex","_rev":"12-4571767ad96a8d93bfce7f84e0218750","name":"filename-reserved-regex","dist-tags":{"latest":"4.0.1"},"versions":{"1.0.0":{"name":"filename-reserved-regex","version":"1.0.0","keywords":["re","regex","regexp","filename","reserved"],"author":{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"filename-reserved-regex@1.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/filename-reserved-regex","bugs":{"url":"https://github.com/sindresorhus/filename-reserved-regex/issues"},"dist":{"shasum":"e61cf805f0de1c984567d0386dc5df50ee5af7e4","tarball":"https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-1.0.0.tgz","integrity":"sha512-UZArj7+U+2reBBVCvVmRlyq9D7EYQdUtuNN+1iz7pF1jGcJ2L0TjiRCxsTZfj2xFbM4c25uGCUDpKTHA7L2TKg==","signatures":[{"sig":"MEUCICwkQnsDANtH7AkkVnM9cr/tx3SDo0ji5p+ZBcLMlsC2AiEAjqdIMthikPowhU5X6lJGJtT4FIeMjlC3eCm7Zp9tPLo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","files":["index.js"],"_shasum":"e61cf805f0de1c984567d0386dc5df50ee5af7e4","engines":{"node":">=0.10.0"},"gitHead":"70c39b691414977a61ca346a2092ee1bf02ff669","scripts":{"test":"node test.js"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"https://github.com/sindresorhus/filename-reserved-regex","type":"git"},"_npmVersion":"2.1.18","description":"Regular expression for matching reserved filename characters","directories":{},"_nodeVersion":"1.0.0","devDependencies":{"ava":"0.0.4"}},"2.0.0":{"name":"filename-reserved-regex","version":"2.0.0","keywords":["re","regex","regexp","filename","reserved","illegal"],"author":{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"filename-reserved-regex@2.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"},"xo":{"esnext":true},"dist":{"shasum":"abf73dfab735d045440abfea2d91f389ebbfa229","tarball":"https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz","integrity":"sha512-lc1bnsSr4L4Bdif8Xb/qrtokGbq5zlsms/CYH8PP+WtCkGNF65DPiQY8vG3SakEdRn8Dlnm+gW/qWKKjS5sZzQ==","signatures":[{"sig":"MEUCIFVE7Y9ay9G7RMDR2xUxBwBqd/uYh+k9VZh3zo6rFtuGAiEAj5A6OP4D3kYqAH3S/dJibgZznBpdbWXbHX0PAae5yaY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","files":["index.js"],"_shasum":"abf73dfab735d045440abfea2d91f389ebbfa229","engines":{"node":">=4"},"gitHead":"af9c88cd73ba944ec27c64173aa9017ec80e7d2a","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":"2.15.9","description":"Regular expression for matching reserved filename characters","directories":{},"_nodeVersion":"4.6.0","devDependencies":{"xo":"*","ava":"*"},"_npmOperationalInternal":{"tmp":"tmp/filename-reserved-regex-2.0.0.tgz_1476072615480_0.5545019111596048","host":"packages-16-east.internal.npmjs.com"}},"3.0.0":{"name":"filename-reserved-regex","version":"3.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@3.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":"3d5dd6d4e2d73a3fed2ebc4cd0b3448869a081f7","tarball":"https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-3.0.0.tgz","fileCount":4,"integrity":"sha512-hn4cQfU6GOT/7cFHXBqeBg2TbrMBgdD0kcjLhvSQYYwm3s4B6cjvBfb7nBALJLAXqmU5xajSa7X2NnUud/VCdw==","signatures":[{"sig":"MEQCIBwd5ishB6JDQas6E4ppwnzKzWJIlaApUEYWhntIRuBkAiAhfumiDUztUqVX1dSU2htwr1C/Zmf2FzS1fWS2uGdLWg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3135,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGa6QCRA9TVsSAnZWagAA/PIP/Rz9fcTB6eHMvpP6PMJv\nsdVO1OeStDiytAze0V8pRV4PjMpNzQma80sV8gwgDXtp7SY1A7rTzYR5o1nr\n5/vs3nw+y+twGbW6BlkWCwp+6htjBfn6jr4St0bUb6gOfFr9E/es82b9ai9D\n3XNGfcGOdtQEkgcf6LQf3+vwKqHLsf/al0hzNYQmkQ8TnEzhEa5dTslMRsNJ\nODdRF/KgeFWMxti06f6Yh/5GFAy4Sogk614U5iN43DFDhIyJMiF+s0m8A93t\n4m77RUxoLdx/ZWXQdASY8xSSY/HtF4zWDX5AyYWT8f/tHV9nEObUhK4jyfT6\nok36C4vFu01GMQt7epq4hRdn1NpIFXexJdBfdyTlSrNHVEEjhUGwSTyAgiM5\nrdPKlp9i45sUPxE8kCEuit2qs0vmyfO1tNy1Hz7VGkAsYyxTBQgrx6WcaUSS\nIZWWeLQYhP4/2ZAdlVqb+XbEIBH164L/4oFAdqxwOxPqsXUCZylYmFAV5tjW\nVWv8Rqjs99apQ0ZD6y0HoFipDJAr/I0i32PLC0s5Zc02wxWNjIv2F712kMGi\nwuFjYljwTZ3cB43fXCYjjgj1SJs2muNICnUslxRJF4zxf8EE0CwE2GYTnrzK\nWFkEvBwXJFjEc1Z6NQtHjcVm6flIQ3TQEdB0ZZCZotoqf+GeUc1gu4St4fw7\nTlSH\r\n=q8ro\r\n-----END PGP SIGNATURE-----\r\n"},"type":"module","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":"./index.js","funding":"https://github.com/sponsors/sindresorhus","gitHead":"fd7b8a31b2f4b898688da847cd59aee0051a604d","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":"7.10.0","description":"Regular expression for matching reserved filename characters","directories":{},"_nodeVersion":"12.22.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.44.0","ava":"^3.15.0"},"_npmOperationalInternal":{"tmp":"tmp/filename-reserved-regex_3.0.0_1629073040077_0.18005453426210316","host":"s3://npm-registry-packages"}},"4.0.0":{"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":"https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-4.0.0.tgz","fileCount":4,"integrity":"sha512-9ZT504KxEQDamsOogZImAWGEN24R1uFAxU3ZS4AZqn2ooidmN68Olh7n4/RcA4lLatZztjA0ZSuxeLHVoCc8JA==","signatures":[{"sig":"MEUCIQDm4HJQ6PRkPNV+dBH7xfBpLovmzkshdTBQDmfkFCMo9AIgAOsdyg27fr3BF0HYnGWPp7FWZbniRgIIu0Q5MPr7cc8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3239},"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"}},"4.0.1":{"_id":"filename-reserved-regex@4.0.1","bugs":{"url":"https://github.com/sindresorhus/filename-reserved-regex/issues"},"dist":{"shasum":"1d5219e42bcb022b2e12e98b4f59dec227f8e48a","tarball":"https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-4.0.1.tgz","fileCount":4,"integrity":"sha512-qUet2faQFKvtvVUsEf7wCrTURwxBOIZpspsLHGifw9QCWk55ITE2FrG8XhfQqG/uxMA1xEGFVQbL+Yfm0O94+Q==","signatures":[{"sig":"MEYCIQD3eE+YTMg0ezijvTkZTnO2cOKyYdEuZSORnkZH5fXzYAIhAO0MziwbrtVTI9pl+vDSoGF00vOhOhLpwXRKVAZeS4e3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCJZpBXlSe+F0ElkKQD0RI+JCFgmVa92Hkl3x9aDgEP9AIhAK+rgRtEl+AMaHryxTS3/ZfZ88h2BDpzV/2p3CP3c2uo"}],"unpackedSize":3586},"name":"filename-reserved-regex","type":"module","author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"d267eb977513e8137062ecca53a15fd78d5b6c92","license":"MIT","scripts":{"test":"xo && ava"},"version":"4.0.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"homepage":"https://github.com/sindresorhus/filename-reserved-regex#readme","keywords":["regex","regexp","filename","reserved","illegal"],"repository":{"url":"git+https://github.com/sindresorhus/filename-reserved-regex.git","type":"git"},"_npmVersion":"12.0.1","description":"Regular expression for matching reserved filename characters","directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"sideEffects":false,"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.2","ava":"^6.4.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/filename-reserved-regex_4.0.1_1787921680653_0.602402142706737"}}},"time":{"created":"2015-01-14T05:11:37.159Z","modified":"2026-08-28T12:54:40.893Z","1.0.0":"2015-01-14T05:11:37.159Z","2.0.0":"2016-10-10T04:10:17.460Z","3.0.0":"2021-08-16T00:17:20.214Z","4.0.0":"2025-09-14T22:05:35.237Z","4.0.1":"2026-08-28T12:54:40.735Z"},"bugs":{"url":"https://github.com/sindresorhus/filename-reserved-regex/issues"},"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","homepage":"https://github.com/sindresorhus/filename-reserved-regex#readme","keywords":["regex","regexp","filename","reserved","illegal"],"repository":{"url":"git+https://github.com/sindresorhus/filename-reserved-regex.git","type":"git"},"description":"Regular expression for matching reserved filename characters","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"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","readmeFilename":"readme.md","users":{"isayme":true,"arteffeckt":true}}