Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
cloak.localstorage
Advanced tools
Cloak.js is a collection of modules for building modern web applications. Each module is designed to work with the others, but are decoupled to allow you pick and choose which ones you need. Want views but don't need to deal with models or a complex router? You can do that! First, make sure you have cloak.core
which contains some basic utilities for each module. Then, install the modules you want.
$ npm install --save cloak.core
$ npm install --save cloak.view
Then, in your JavaScript, just start using the components. Cloak is designed to work in a CommonJS environment, so any tools that do so will work (like common.js or browserify).
var View = require('cloak.view');
var MyView = module.exports = View.extend({
template: 'views/myview/myview.hbs',
draw: function() {
this.elem.innerHTML = this.render();
}
});
View
classModel
and Collection
classes for handling dataRouter
class for all you app routing needsController
class for transitioning displaying viewsXMLHttpRequest
; Also provides an interface to define XHR methods on the Model
and Controller
classesModel
and Collection
classes$ npm install --save cloak.core cloak.model cloak.localstorage
The cloak.localstorage
module is intended for apps that operate entirely in localstorage, as opposed to storing data on an API server. It extends the Model
class with methods for performing CRUD operations inside of localstorage.
var Model = require('cloak.model');
var store = require('cloak.localstorage');
store.extendModel(Model);
var Person = Model.extend({
attrs: {
name: ''
}
});
// Let's create a new person, "Bob"
var bob = new Person({ name: 'Bob' });
// Now, let's save Bob into localStorage
bob.save();
// Next, we query the Person collection in localStorage for models with
// the name "Bob"
var bobs = Person.find({ name: 'Bob' });
// What we get back is a Person Collection containing the models found,
// in this case, we found Bob! :)
bobs instanceof Person.Collection; // true
bobs.len() === 1; // true
bobs.at(0).get('name') === 'Bob'; // true
FAQs
The cloak.js localstorage module
The npm package cloak.localstorage receives a total of 0 weekly downloads. As such, cloak.localstorage popularity was classified as not popular.
We found that cloak.localstorage 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.