Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.