Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
blockstack-storage
Advanced tools
Blockstack storage API access for Javascript clients.
new Promise((resolve), (reject) => {
blockstack.putFile("/hello_world", "hello world!")
.then(() => {
// /hello_world exists now, and has the contents "hello world!".
resolve(true);
});
});
new Promise((resolve), (reject) => {
blockstack.getFile("/hello_world")
.then((fileContents) => {
// get back the file /hello_world
assert(fileContents === "hello world!");
resolve(true);
});
});
new Promise((resolve), (reject) => {
blockstack.getFile("/non/existant/file")
.then((absentFileContents) => {
// no data if it doesn't exist
assert(absentFileContents === null);
resolve(true);
});
});
new Promise((resolve), (reject) => {
blockstack.mkdir("/home")
.then(() => {
return blockstack.mkdir("/home/demo1");
})
.then(() => {
return blockstack.mkdir("/home/demo2");
})
.then(() => {
return blockstack.mkdir("/home/demo3");
})
.then(() => {
// directory '/home' exists, and has
// children 'demo1', 'demo2', and 'demo3'
resolve(true);
});
});
new Promise((resolve), (reject) => {
blockstack.listdir("/home")
.then((dir) => {
// have 'demo1', 'demo2', and 'demo3'
assert(dir.children.length === 3);
for (let name of ['demo1', 'demo2', 'demo3']) {
if( !Object.keys(dir['children']).includes(name) ) {
reject(`Missing ${name}`);
}
}
resolve(true);
});
});
new Promise((resolve), (reject) => {
blockstack.stat("/home")
.then((dirHeader) => {
// path exists
resolve(true);
})
.catch((error) => {
// path does not exist
reject(error);
});
});
new Promise((resolve), (reject) => {
blockstack.deleteFile("/hello_world")
.then(() => {
// file was deleted
resolve(true);
})
.catch((error) => {
// file does not exist or is inaccessable
reject(error);
});
});
new Promise((resolve), (reject) => {
blockstack.rmdir("/home/demo1")
.then(() => {
// can delete empty directories,
// but not non-empty ones.
return blockstack.rmdir("/home")
.catch((error) => {
// delete children
return Promise.all([blockstack.rmdir("/home/demo2"), blockstack.rmdir("/home/demo3")]);
})
.then((results) => {
// delete parent
return blockstack.rmdir("/home");
})
.then(() => {
// / is now empty
resolve(true);
});
});
});
FAQs
The Blockstack Javascript library for storage.
The npm package blockstack-storage receives a total of 0 weekly downloads. As such, blockstack-storage popularity was classified as not popular.
We found that blockstack-storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.