
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Rackit is a module for managing large collections of files on Rackspace Cloud Files. Rackit automatically creates containers as needed, and will seamlessly reauthenticate if your API key expires. Rackit also supports the generation of temporary, time-limited file URLs.
Cloud Files has a recommended limit of 50,000 files per container. Rackit knows this, and will automatically create new containers as necessary.
With Rackit, you specify a container prefix, such as 'file'. Then, Rackit will create containers ['file0', 'file1', ...] as necessary.
For security, privacy, and ease, Rackit stores files on the cloud with random names, which it returns to you.
$ npm install rackit
var rackit = require('rackit');
// Initialize with your account information
rackit.init({
'user' : '<your Rackspace username>',
'key' : '<your Rackspace API key>'
}, function(err) {
// Add a local file to the cloud
rackit.add(__dirname + '/image.jpg', function(err, cloudPath) {
// Get the CDN URI of the file
console.log(rackit.getURI(cloudPath));
});
});
Optionally, you may create your own Rackit instance. This is necessary if you are accessing multiple Cloud File accounts.
var Rackit = require('rackit').Rackit;
var myRackit = new Rackit({
'user' : '<your Rackspace username>',
'key' : '<your Rackspace API key>'
});
myRackit.init(function(err) {
// Add a local file to the cloud
myRackit.add(__dirname + '/image.jpg', function(err, cloudPath) {
// Get the CDN URI of the file
console.log(myRackit.getURI(cloudPath));
});
});
When initializing Rackit, here are the options and defaults:
{
user : '', // Your Rackspace username
key : '', // Your Rackspace API key
prefix : 'dev', // The prefix for your Cloud Files containers
baseURI : 'https://auth.api.rackspacecloud.com/v1.0', // The API entry point - may change based on your country
tempURLKey : null, // A secret for generating temporary URLs
useSNET : false,
useCDN : true,
useSSL : true,
verbose : false, // If set to true, log messages will be generated
logger : console.log // Function to receive log messages
}
Uploads a file to the cloud. The uploaded file will be given a random 24-character file name.
Downloads a file from the cloud.
Permanently deletes a file from the cloud.
Upserts the metadata for the specified cloud file.
Returns a URI for a given file. If the ttl parameter is omitted, then a CDN URI will be returned (if the container is CDN enabled). If ttl is specified, a temporary URI will be given which is valid for ttl seconds.
** theoretical limit
FAQs
Super simple Rackspace Cloud Files client
The npm package rackit receives a total of 6 weekly downloads. As such, rackit popularity was classified as not popular.
We found that rackit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.