
Security News
n8n Tops 2025 JavaScript Rising Stars as Workflow Platforms Gain Momentum
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.
@humanwhocodes/object-store
Advanced tools
An in-memory object store modeled on cloud drives like Google Drive.
If you find this useful, please consider supporting my work with a donation or nominate me for a GitHub Star.
An implementation of an in-memory object store modeled on cloud drives like Google Drive. This is useful mostly for testing purposes.
Install using [npm][npm] or [yarn][yarn]:
npm install @humanwhocodes/object-store
# or
yarn add @humanwhocodes/object-store
Import into your Node.js project:
// CommonJS
const { ObjectStore } = require("@humanwhocodes/object-store");
// ESM
import { ObjectStore } from "@humanwhocodes/object-store";
Install using JSR:
deno add @humanwhocodes/object-store
#or
jsr add @humanwhocodes/object-store
Then import into your Deno project:
import { ObjectStore } from "@humanwhocodes/object-store";
Install using this command:
bun add @humanwhocodes/object-store
Import into your Bun project:
import { ObjectStore } from "@humanwhocodes/object-store";
It's recommended to import the minified version to save bandwidth:
import { ObjectStore } from "https://cdn.skypack.dev/@humanwhocodes/object-store?min";
However, you can also import the unminified version for debugging purposes:
import { ObjectStore } from "https://cdn.skypack.dev/@humanwhocodes/object-store";
const store = new ObjectStore();
const file = store.createFile("foo.txt", { content: "Foo", parentId: "folder_id" });
console.log(file);
/*
{
id: "file_id",
name: "foo.txt",
type: "file",
parent_id: "parent_id",
created_at: "2022-10-20T12:00:00Z",
modified_at: "2022-10-20T12:00:00Z",
}
*/
Note: When parentId is omitted, the root folder is used.
const store = new ObjectStore();
const file = store.createFile("foo.txt", { content: "Foo", parentId: "folder_id" });
const copiedFile = store.copyFile(file.id, { parentId: "some_other_folder_id", name: "bar.txt"});
console.log(copiedFile);
/*
{
id: "copy-file-id",
name: "bar.txt",
type: "file",
parent_id: "some_other_folder_id",
created_at: "2022-10-20T12:00:00Z",
modified_at: "2022-10-20T12:00:00Z"
}
*/
Note: name is optional. When parentId is not specified, the ID of the original's parent is used.
const store = new ObjectStore();
const file = store.createFile("foo.txt", { content: "Foo", parentId: "folder_id" });
const updatedFile = store.updateFile(file.id, { parentId: "some_other_folder_id", name: "bar.txt"});
console.log(updatedFile);
/*
{
id: "file-id",
name: "bar.txt",
type: "file",
parent_id: "some_other_folder_id",
created_at: "2022-10-20T12:00:00Z",
modified_at: "2022-10-20T12:00:00Z"
}
*/
Note: Both name and parentId are optional.
const store = new ObjectStore();
const file = store.createFile("foo.txt", { content: "Foo" });
const retrievedFile = store.getFile(file.id);
console.log(retrievedFile);
/*
{
id: "file_id",
name: "foo.txt",
type: "file",
parent_id: "parent_id",
created_at: "2022-10-20T12:00:00Z",
modified_at: "2022-10-20T12:00:00Z",
}
*/
const store = new ObjectStore();
const file = store.createFile("foo.txt", { content: "Foo" });
const content = store.getFileContent(file.id);
console.log(content); // "Foo"
const store = new ObjectStore();
const file = store.createFile("foo.txt", { content: "Foo" });
store.deleteFile(file.id);
const store = new ObjectStore();
const folder = store.createFolder("my-folder", { parentId: "parent_folder_id" });
console.log(folder);
/*
{
id: "folder_id",
name: "my-folder",
type: "folder",
parent_id: "parent_id",
created_at: "2022-10-20T12:00:00Z",
modified_at: "2022-10-20T12:00:00Z",
entries: []
}
*/
Note: When parentId is omitted, the root folder is used.
const store = new ObjectStore();
const folder = store.createFolder("my-folder", { parentId: "parent_folder_id" });
const copiedFolder = store.copyFolder(folder.id, { parentId: "some_other_folder_id", name: "my-folder-copy"});
console.log(copiedFolder);
/*
{
id: "folder_copy_id",
name: "my-folder-copy",
type: "folder",
parent_id: "some_other_folder_id",
created_at: "2022-10-20T12:00:00Z",
modified_at: "2022-10-20T12:00:00Z",
entries: []
}
*/
Note: name is optional. When parentId is not specified, the ID of the original's parent is used.
const store = new ObjectStore();
const folder = store.createFolder("my-folder", { parentId: "parent_folder_id" });
const updatedFolder = store.updateFolder(file.id, { parentId: "some_other_folder_id", name: "my-new-name"});
console.log(updatedFolder);
/*
{
id: "folder_id",
name: "my-new-name",
type: "folder",
parent_id: "some_other_folder_id",
created_at: "2022-10-20T12:00:00Z",
modified_at: "2022-10-20T12:00:00Z",
entries: []
}
*/
const store = new ObjectStore();
const folder = store.createFolder("my-folder");
store.deleteFolder(folder.id);
npm install to setup dependenciesnpm test to run testsApache 2.0
FAQs
An in-memory object store modeled on cloud drives like Google Drive.
We found that @humanwhocodes/object-store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.

Security News
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.

Security News
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.