{"id":49755,"library":"workshopper-adventure-storage","title":"workshopper-adventure-storage","description":"A simple JSON file-based storage module for workshopper-adventure, used to persist user preferences and progress. Version 3.0.1 is the latest release, with low release cadence (last updated in 2016). It provides save, get, and reset methods for managing a directory of JSON files. Differentiator: lightweight and focused on the workshopper ecosystem, avoiding the complexity of full database solutions.","status":"maintenance","version":"3.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/workshopper/workshopper-adventure-storage","tags":["javascript","workshopper","util"],"install":[{"cmd":"npm install workshopper-adventure-storage","lang":"bash","label":"npm"},{"cmd":"yarn add workshopper-adventure-storage","lang":"bash","label":"yarn"},{"cmd":"pnpm add workshopper-adventure-storage","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package does not support ES modules; use CommonJS require.","wrong":"import createStorage from 'workshopper-adventure-storage'","symbol":"createStorage","correct":"const createStorage = require('workshopper-adventure-storage')"},{"note":"A default directory path for user data.","symbol":"createStorage.userDir","correct":"createStorage.userDir"},{"note":"Saves JSON-encoded data to a file named 'name.json'.","symbol":"storage.save","correct":"storage.save('name', data)"}],"quickstart":{"code":"const createStorage = require('workshopper-adventure-storage');\nconst storage = createStorage(createStorage.userDir, 'my-workshopper');\nstorage.save('progress', { completed: ['lesson1'] });\nconst data = storage.get('progress');\nconsole.log(data); // { completed: ['lesson1'] }\nstorage.reset(); // clears the storage directory","lang":"javascript","description":"Initializes storage in a user-specific directory, saves progress JSON, retrieves it, and resets the storage."},"warnings":[{"fix":"Check file existence manually before saving if needed.","message":"storage.save always overwrites existing file without warning.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always check for null after calling storage.get.","message":"storage.get returns null if file does not exist; no error handling.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use in small directories; consider using async alternatives for large data.","message":"storage.reset is synchronous and can block the event loop for large directories.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'2016':37 '3.0.1':25 'adventur':3,16 'avoid':60 'base':10 'cadenc':33 'complex':62 'databas':65 'differenti':52 'directori':48 'ecosystem':59 'file':9,51 'file-bas':8 'focus':55 'full':64 'get':41 'javascript':67 'json':7,50 'last':34 'latest':28 'lightweight':53 'low':31 'manag':46 'method':44 'modul':12 'persist':19 'prefer':21 'progress':23 'provid':39 'releas':29,32 'reset':43 'save':40 'simpl':6 'solut':66 'storag':4,11 'updat':35 'use':17 'user':20 'util':69 'version':24 'workshopp':2,15,58,68 'workshopper-adventur':14 'workshopper-adventure-storag':1","created_at":"2026-06-07T17:03:26.542118+00:00","updated_at":"2026-06-07T17:03:26.542118+00:00","problems":[{"fix":"Use const createStorage = require('workshopper-adventure-storage') and ensure package is installed.","cause":"Using ES import syntax or incorrect require path.","error":"TypeError: createStorage is not a function"},{"fix":"Ensure parent directories exist before calling createStorage.","cause":"Storage directory does not exist; createStorage does not create intermediate directories.","error":"Error: ENOENT: no such file or directory, open '...'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/workshopper/workshopper-adventure-storage#readme","github":"https://github.com/workshopper/workshopper-adventure-storage","docs":null,"changelog":null,"pypi":null,"npm":"workshopper-adventure-storage","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}