
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
gulp-elementsjs-interpreter
Advanced tools
parses files for elementsJS syntax, and replaces it with 'legal' elementsJS alias functions

If you don't know how to use gulp, you can find a nice tutorial here. First, you will need to install the gulp-elementsJS-interpreter package (Along with gulp and any other plug-ins you'll be using). It is available on npm's registry:
$ npm i --save-dev gulp-elementsJS-interpreter
In case you are new to npm, the --save-dev simply lists the package as one of your devDependencies in your application's package.json file. To use the interpreter, see below:
//import the necessary modules
var elemsJS = require('gulp-elementsJS-interpreter'),
uglify = require('gulp-uglify'),
babel = require('gulp-babel'),
gulp = require('gulp');
//define task, source file and destination
gulp.task('default', ()=> {
var srcJS = './index.js',
dest = './dist/';
//stream file through elemsJS-interpreter, babel and uglify
return gulp.src(srcJS)
.pipe(elemsJS()) //<<-ALWAYS PUT AT BEGINNING OF STREAM.
.pipe(babel())
.pipe(uglify())
.pipe(gulp.dest(dest));
});
--
The imports() function is a convenience function that allows the quick importing of many modules and/or module functions all at once. It is not necessary to use this function in order to use the library, it just makes it quicker/easier to import all of its' functions separately.
In order to use the imports function, it must first be imported from the module as such:
var imports = require('elementsJS').imports;
or,
import { imports } from 'elementsJS';
imports( {module: funcs/moduleAlias} ){module: funcs or moduleAlias} (object) - An object, the key of which is the name of a module (string) ex. 'lodash', and the value is either a list of functions (array) ex. ['make', 'go'], or the variable name given to the module being imported (string) ex. '_', for lodash.Returns: nuffin.
The imports function can be used to conveniently import individual functions from modules, or entire modules. If functions will be imported from the module individually, usage is as below:
imports({
'elementsJS': ['make', 'go', 'dom', 'on'],
'../js/utils': ['buildMenu'], // << see Note below *
'lodash': '_'
});
//functions are used like so:
make('#foo', 'button');
buildMenu();
Entire modules can be imported like so:
imports({
'elementsJS': 'elemsJS',
'../js/utils': 'utils',
'lodash': '_',
});
//functions are used like so:
elemsJS.make('#foo', 'button');
utils.buildMenu();
FAQs
parses files for elementsJS syntax, and replaces it with 'legal' elementsJS alias functions
We found that gulp-elementsjs-interpreter 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.