Disable write to disk
# crawlee-js
l
By default, data will be write to ./storage, is there a way to turn off this and use memory instead ?
h
Someone will reply to you shortly. In the meantime, this might help:
l
Like storing the data in an array variable?
a
What data you want to disable writing to disk? Scraping output or crawling stats/queues or what? I don't think you should disable it altogether (especially the crawlee stats/queues)
m
If the problem is that data, like queues, is persisted across runs, you can try using `apify run --purge`: https://docs.apify.com/cli/docs/reference#apify-run
c
Copy code
ts
Configuration.set("persistStorage", false)
setting this before starting your crawler should do the trick. btwm you can also change the storage dir using something like
Copy code
ts
const storageClient = new MemoryStorage({
  localDataDirectory: crawlStoragePath,
  persistStorage: true,
});
if you simply wanted to change the storage location
p
I'll just add another example:
Copy code
typescript
import { MemoryStorage } from '@crawlee/memory-storage';
import { PlaywrightCrawler } from 'crawlee';
import { RequestQueue } from 'apify';

export const memoryRequestQueue = await RequestQueue.open(null, {
    storageClient: new MemoryStorage(),
});

const crawler = new PlaywrightCrawler({
    proxyConfiguration,
    requestQueue: memoryRequestQueue,
    // ...
});
etc.