
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
braincloud-node
Advanced tools
npm i braincloud-node
or if still in development
npm i git+ssh://git@bitbucket.org:bitheadsinc/braincloud-node.git
var bc = require("braincloud-node")
function authenticated(response) {
console.log("Did get Authenticated to profileId:" + response.data.profileId);
var shareable = true;
var replaceIfExists = true;
_bc.brainCloudClient.file.prepareFileUpload("tests","dummyFile",shareable,replaceIfExists,)
}
_bc = new bc.BrainCloudWrapper("_mainWrapper");
// This Node implementation does not use jQuery so turn it off.
_bc.brainCloudManager.useJQuery(false);
secret = "aaaaaaaa-bbbb-0000-cccc-111111111111";
appId = "00000";
console.log("Initializing brainCloud");
_bc.initialize(appId, secret, "1.0.0");
console.log("Authenticating anonymously to brainCloud");
_bc.authenticateAnonymous(authenticated);
The file upload works slightly different in this implementation. Instead of using XMLHttpRequest you need to use XMLHttpRequest4Upload. Also the file object passed into uploadFile call needs to be a Read Stream from the nodes fs module.
var fs = require("fs")
...
_bc.brainCloudClient.file.prepareFileUpload("test2", fileName, shareable, replaceIfExists, fileSize, function (result) {
if (result.status == 200) {
var uploadId = result.data.fileDetails.uploadId;
var xhr = new XMLHttpRequest4Upload();
file2 = fs.createReadStream("./someFile.ext");
file2.size = fileSize;
xhr.addEventListener("load", transferComplete);
xhr.addEventListener("error", transferFailed);
console.log("Uploading file with id:" + uploadId + " (size : " + fileSize + " )");
_bc.brainCloudClient.file.uploadFile(xhr, file2, uploadId);
} else {
console.log("Error preparing for upload, " + result.reason_code );
}
}
...
Only load and error listeners are triggered in this implementations.
Sessions are not maintained across executions of scripts. i.e. Each script must initialy login.
FAQs
brainCloud client for NodeJS
The npm package braincloud-node receives a total of 1 weekly downloads. As such, braincloud-node popularity was classified as not popular.
We found that braincloud-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.