{"name":"mem-fs","version":"4.1.1","author":{"name":"Simon Boudrias"},"license":"MIT","_id":"mem-fs@4.1.1","maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"},{"name":"mshima","email":"marceloshima@gmail.com"}],"homepage":"https://github.com/SBoudrias/mem-fs#readme","bugs":{"url":"https://github.com/SBoudrias/mem-fs/issues"},"dist":{"shasum":"2b5dfe2b8a3728b34560c041539dbcc6f05273d8","tarball":"http://registry-npm.ywwl.com/mem-fs/download/mem-fs-4.1.1.tgz","fileCount":4,"integrity":"sha512-GwrbYV4U8h1iTfj3Yac2xxSMw1HGVbf3GcTKriFLf1hUmgoUwVPsfcp8ZQLYr6kiAHNXA9ozxrY5JuA23SjGFA==","signatures":[{"sig":"MEUCIQCyse/k1zyoZeBRHbC52OKOgAX22MOE0smsyIFcSoAWRwIgYkNTPid79NQY8tjgrUpz1meNvAi9QF1CtiOIezunhrM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8984,"size":2722,"noattachment":false,"key":"/mem-fs/-/mem-fs-4.1.1.tgz"},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"dd6d3bdec256fd08687212275902fef478823fd4","scripts":{"test":"vitest run --coverage","prepare":"tsc","pretest":"eslint ."},"_npmUser":{"name":"mshima","email":"marceloshima@gmail.com"},"repository":{"url":"git+https://github.com/SBoudrias/mem-fs.git","type":"git"},"_npmVersion":"10.8.2","description":"Simple in-memory vinyl file store","directories":{},"_nodeVersion":"18.20.4","dependencies":{"vinyl":"^3.0.0","vinyl-file":"^5.0.0","@types/node":">=18","@types/vinyl":"^2.0.8"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.50.0","vitest":"^0.34.6","prettier":"^3.0.3","typescript":"^5.2.2","eslint-config-xo":"^0.43.1","@vitest/coverage-v8":"^0.34.6","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","@typescript-eslint/parser":"^6.7.4","@typescript-eslint/eslint-plugin":"^6.7.4"},"_npmOperationalInternal":{"tmp":"tmp/mem-fs_4.1.1_1728730969191_0.008558136630430813","host":"s3://npm-registry-packages"},"readme":"# mem-fs\n\nSimple in-memory vinyl file store.\n\n## Usage\n\n### Loading a file\n\nYou access a file using `store#get()` method. If the file is in memory, it will be used. Otherwise, we'll load the file from the file-system.\n\n```js\nimport { create } from 'mem-fs';\n\nconst store = create();\nstore.get('/test/file.txt');\n```\n\nWhen trying to load a file we cannot read from disk, an empty Vinyl file will be returned. The `contents` of this file will be set to `null`.\n\nTrying to get a directory or any invalid files will also return an empty Vinyl file pointer.\n\n### Adding/updating a file\n\nYou update file references by using `store#add()` method. This method take a `vinyl` file object as parameter.\n\n```js\nimport File from 'vinyl';\nimport { create } from 'mem-fs';\n\nconst coffeeFile = new File({\n  cwd: '/',\n  base: '/test/',\n  path: '/test/file.coffee',\n  contents: new Buffer('test = 123'),\n});\n\nconst store = create();\nstore.add(coffeeFile);\n```\n\n### Iterating over the file system\n\nUsing `store#each(cb(file, index))`, you can iterate over every file stored in the file system.\n\n### Get all files\n\nUsing `store#all()`, you can get every file stored in the file system.\n\n### Check existence in the file system\n\nUsing `store#existsInMemory()`, you can check if the file already exists in the file system without loading it from disk.\n\n### Stream every file stored in the file system\n\nUsing `store#stream()`, you can create a stream with every file stored in the file system.\n\n### Pass stored files through a pipeline\n\n`store#pipeline()` generates a new map with yielded files in transforms.\nIf no transform is passed, files references are updated.\n","publish_time":1728730969390,"_cnpm_publish_time":1728730969390,"dist-tags":{"latest":"6.0.0"}}