
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
freightCrane
Advanced tools
[](https://travis-ci.org/freightCrane/freightCrane)
freightCrane helps you get started with using cloud storage (Like Dropbox or GitHub). With freightCrane you just need to learn 1 API and you can easily add support for more providers in your project.
Storage | Status | Read more about storage |
---|---|---|
Dropbox | Implemented | https://www.dropbox.com/ |
localStorage | Implemented | https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage |
GitHub | Implemented | https://github.com/ |
MS Azure | Planned | https://account.windowsazure.com/Home/Index |
SkyDrive | Planned | https://skydrive.live.com/ |
Google Drive | Planned | https://drive.google.com/ |
Box | Planned | https://www.box.com/ |
https://jstorage.azurewebsites.net/demo/
Depending on the storage provider you want to use you need to do some steps at the provider to prepare it for usage. Below we are listing the steps needed for every provider.
There is two ways of using GitHub. The recommended way is to use a token service, this way your users will easily be redirected to GitHub to login, approve your application (And your required scope) and that is it. The other method requires your users to login to GitHub, navigate to a page and manually create a token, copy the token and use in your application.
Following steps are general for both methods.
##Setup
include
<script src="freightCrane.js">
and the approperate module that represent the storage you want to use. You can use all of them at the same time.
<script src="freightCrane.dropbox.js">
<script src="freightCrane.github.js">
<script src="freightCrane.localstorage.js">
##API##
Dropbox
var storage = freightCrane({
'name': 'dropbox',
'appKey': 'APP KEY YOU SAVED FROM STEP 6 IN PREPARE DROPBOX SECTION',
'callback': function(storage, callStatus) {
if (callStatus.isOK) {
// dropbox storage are now ready to be used.
}
}
});
GitHub (Token Service)
var storage = freightCrane({
'name': 'github',
'repo': 'REPOSITORY NAME YOU WANT YOUR USERS TO ACCESS',
'scope': 'repo',
'tokenService': 'https://githubtokenservice-jstorage-flowertwig-org.loopiasecure.com/', // You SHOULD use your own service for additional security
'callback': function(storage, callStatus) {
if (callStatus.isOK) {
// github storage are now ready to be used.
}
}
});
GitHub (Token)
var storage = freightCrane({
'name': 'github',
'repo': 'REPOSITORY NAME YOU WANT YOUR USERS TO ACCESS',
'token': 'TOKEN user has entered'
'callback': function(storage, callStatus) {
if (callStatus.isOK) {
// github storage are now ready to be used.
}
}
});
localStorage
var storage = freightCrane({
'name': 'localstorage',
'callback': function(storage, callStatus) {
if (callStatus.isOK) {
// local storage are now ready to be used.
}
}
});
Read content of file.
storage.get('testing.txt', function(file, callStatus) {
if (callStatus.isOK) {
}
});
Write file content.
storage.set('testing.txt', 'Hello World!', function(metaData, callStatus) {
if (callStatus.isOK) {
}
});
Move file from one location to a new.
storage.move('testing.txt', 'testing2.txt', function(callStatus) {
if (callStatus.isOK) {
}
});
Remove file or folder.
storage.del('testing.txt', function(callStatus, file_or_folder_path) {
if (callStatus.isOK) {
}
});
List all files in directory.
storage.lists('/', function(files, callStatus) {
if (callStatus.isOK) {
for(var i = 0; i < files.length; i++) {
// files[i].name
}
}
});
Does file exists?
storage.exists('testing.txt', function(file_exists, callStatus) {
if (callStatus.isOK) {
if (file_exists) {
// File exists
} else {
// File didn't exist
}
}
});
{
'name': 'dropbox',
[...]
'callback': function(callStatus) {
}
}
Indicate if the call was successfull or not. Object has the following properties:
{
'isOK': true,
'code': 0,
'msg': ''
}
Object used in get method, object has the following properties:
{
'name': 'testing.txt',
'size': 1024,
'mime-type': 'text/html',
'modified': Wed Jan 01 2014 15:11:07 GMT+0100 (W. Europe Standard Time),
'data': byte array or string depending on mime-type
}
Object returned for getMeta and list methods, object has the following properties:
{
'name': 'testing.txt',
'size': 1024,
'mime-type': 'text/html'
'modified': Wed Jan 01 2014 15:11:07 GMT+0100 (W. Europe Standard Time)
}
MIT
npm install && npm test
Setting up dropbox and github for testing.
tests/testconfig-example.js
to tests/testconfig.js
tests/testconfig.js
according to
"Prepare Providers".python -m SimpleHTTPServer
in the repo folder on Unix/Linux/BSD-based systems)./tests/index.htm
in your browser on the path to the local webserver.FAQs
[](https://travis-ci.org/freightCrane/freightCrane)
We found that freightCrane 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.