mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Reduce memory usage on saveList
This commit is contained in:
parent
4a493d2741
commit
275ab89f00
1 changed files with 6 additions and 11 deletions
|
|
@ -159,20 +159,15 @@ class BuildLists {
|
|||
|
||||
const saveableList = saveMethod( this.lists[listOptions.name] )
|
||||
|
||||
console.log('saveableList', typeof saveableList)
|
||||
// console.log('saveableList', typeof saveableList)
|
||||
|
||||
// Stringify one at a time to allow for large lists
|
||||
const saveableListJSON = '[' + saveableList.map(el => JSON.stringify(el)).join(',') + ']'
|
||||
|
||||
// Write the list to JSON
|
||||
await fs.writeFile(listFullPath, JSON.stringify( saveableList ))
|
||||
await fs.writeFile(listFullPath, saveableListJSON)
|
||||
|
||||
// Read back the JSON we just wrote to ensure it exists
|
||||
const savedListJSON = await fs.readFile(listFullPath, 'utf-8')
|
||||
|
||||
// console.log('savedListJSON', savedListJSON)
|
||||
|
||||
const savedList = JSON.parse(savedListJSON)
|
||||
|
||||
// Import the created JSON File
|
||||
return savedList
|
||||
return
|
||||
}
|
||||
|
||||
// Run all listsOprions methods
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue