Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
bring-your-own-storage-utilities
Advanced tools
bitcoin: bc1q9fpu6muvmg5fj76pyzg3ffjrmksnvfj3c0xva6
!! Alpha Stage !!
Currently, most functions are prototypes that need to be optimized and attempt to reduce dependency. They work just fine right now, but more can be done.
You can test this repo right now, in your browser. You can view the developer console (F12) when you enter to see the very tests you can run in node. It takes a bit of startup time because of the supporting test tools.
npm install bring-your-own-storage-utilities --save
You can use the Adapt.iSource interface or if your source resembles the interface at all, it will probably work. Using the interface will ensure that the source is adapted to the utilities of the BYOSU Apis.
// Example using a standard javascript object as a source.
// See tests/adapt.js for this very thing at work.
import {Adapt} from "bring-your-own-storage-utilities";
const obj = {};
const yourSource = Adapt.iSource({
async get(key) {
return obj[key];
},
async exists(key) {
return !!obj[trimStart(key, "/")];
},
async put(key, buffer, config) {
obj[key] = buffer;
},
async del(key) {
if (obj[key]) {
delete obj[key];
}
},
* readdir(path) {
path = trimEnd(coercePathAbsolute(path), "/") + "/";
for (let key of Object.keys(obj)) {
key = coercePathAbsolute(key);
if (key.startsWith(path)) {
yield key.slice(path.length).split("/").shift();
}
}
},
// NEW. Experimental, this format may change.
async exec(key, config = {}) {
const {
// Handler sticks out to public so that it can be 'micro-managed'
handler: async (key, config) => {
console.log(`"Executed ${key}`);
}
} = config;
// It would be good to get info on the file here
// and do any security checks, validations,
// or user notifications before sending to handler.
return handler(key, config);
}
});
Your source after the above example will magically acquire much of the query API methods and can be used in any of the other api
import * as BYOSU from "bring-your-own-storage-utilities"
import {Adapt, Find, Query, Resolve, Transport, Deploy} from "bring-your-own-storage-utilities"
Query
import * as Query from "bring-your-own-storage-utilities/query"
You could say this is pretty similar to find. But, query is where you've found a resource now you need to understand that resource
Find
import * as Find from "bring-your-own-storage-utilities/find"
The find api functions mainly finding stuff in the source storage or making it easier to find stuff.
Resolve
import * as Resolve from "bring-your-own-storage-utilities/resolve"
Have an id, specifier, import, name, hash table, whatever, this section should be for resolving these identifiers and indexers to a resource.
require
or es6's import
node_modules
folderpackage.json
from child directory up to root directoryAdapt
Any adaptors that can help to use common sources. Or any adaptors to pipe the source to be consumed by other API.
Transport
You need data from your source to go from point A to point B. Transport will help.
Deploy
You need to deploy something from your source to the end-user.
rollup module
, or this library will download
it when Deploy.pack
is used. See Deploy.setRollup in the api.Deploy.setSvelteCompiler
in the api.
Components
Svelte components for handling source storages.
sdk
npm test
Distributed under the MIT license. See LICENSE
for more information.
FAQs
Utilities for storage devices you bring on your own
We found that bring-your-own-storage-utilities demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.