{"name":"mem-fs","version":"4.1.2","author":{"name":"Simon Boudrias"},"license":"MIT","_id":"mem-fs@4.1.2","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":"9c09d1344d88968e940b0e3366048ed8973bb78a","tarball":"http://registry-npm.ywwl.com/mem-fs/download/mem-fs-4.1.2.tgz","fileCount":4,"integrity":"sha512-CMwusHK+Kz0tu1qjgbd0rwcJxzgg76jlkPpqK+pDTv8Hth8JyM7JlgxNWaAFRKe969HATPTz/sp8T63QflyI+w==","signatures":[{"sig":"MEUCIQCinAj0mUUpHKfTPtqOIauEArD1uX+VxGKoDZv1Egy05AIgCyfIjhdKXpOoyxIPyd2IlAOMkR2vzbx0SMbXLJS9ym0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9032,"size":2739,"noattachment":false,"key":"/mem-fs/-/mem-fs-4.1.2.tgz"},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"a05e3761b8d23e56f3923d7a07209c96e86a4406","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":"22.12.0","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.2_1734004751114_0.2581764584138675","host":"s3://npm-registry-packages-npm-production"},"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":1734004751301,"_cnpm_publish_time":1734004751301,"dist-tags":{"latest":"6.0.0"}}