Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
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.i18n
The cloak.i18n
module provides a really basic internationalization interface. It enables you to store translations in simple JS files and then have the correct translation selected.
Your file structure will look something like this:
app
|-- i18n
| |-- index.js
| `-- en-us.js
|-- app.js
module.exports = {
auth: {
login: 'Please login',
bad_password: 'Password was incorrect, please try again'
}
};
exports['en-us'] = require('./en-us');
// Load the module
var i18n = require('cloak.i18n');
// Include our translations stored in the i18n directory
i18n.init(require('./i18n'));
// Translate some stuff
i18n.translate('auth.login'); // returns "Please login"
Once your translations are setup, the module will determine the best language to use based on browser settings and previous user selections. To change the language manually, you can use i18n.lang()
, like so:
// This will use the "en-gb" (english, great britain) lanuage and store that
// preference in local storage for later uses
i18n.lang('en-gb');
FAQs
The cloak.js i18n module
The npm package cloak.i18n receives a total of 10 weekly downloads. As such, cloak.i18n popularity was classified as not popular.
We found that cloak.i18n 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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.