
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Work in progress - not ready to use! Come back in a few weeks :-)
Jet.js (JS Plugin Executor) is a simple JavaScript plugin execution library for websites that don't need a framework like react or vue.js. Its like jQuery but only the plugin part.
$ npm i jet-js
Include the jet.js library as Script Tag inside your head or body tag.
<!doctype html>
<html>
<head>
<!-- ... -->
<!-- use with defer attribute to safely execute JavaScripts in the right order -->
<script type="text/javascript" src="/path/to/your/js-resources/jet.js" defer></script>
</head>
<body>
<!-- ... -->
<!-- or include it at the bottom of your body tag -->
<script type="text/javascript" src="/path/to/your/js-resources/jet.js"></script>
</body
</html>
dataset API.dataset API.Page-Load
Load more HTML via AJAX
<div class="card">
<img class="card__head-img" data-jetjs-plugin="parralax" />
<div class="card__body">
...
</div>
</div>
Just define a data-jetjs-plugin="<PLUGIN_NAME>" Attribute. The Plugin will exeuted automatically. If you need to pass some options, just define it as an attribute: data-jetjs-<PLUGIN_NAME>="{complexJson:{...}} or if you only need to define a very specific option, you can write data-jetjs-<PLUGIN_NAME>-<OPTION_NAME>="<VALUE>".
To execute multiple plugins on the same element, just define it via the data-jetjs-plugins Attribute and use a , (comma) as delimiter (Whitespaces around the comma will be ignored). e.g:
<img class="card__head-img" data-jetjs-plugins="parralax, imgZoom" />
The other option is to use pipes. They can be combined with plugins delimited by a comma. e.g.:
<ul class="some-ui-element" data-jetjs-plugins="childCount | updateClass, parralax, imgZoom"
But in this case only the updateClass Plugin recevie the childCount value. Because the Pipe ends at the comma. Each Plugin(s) delimited by comma are exectuted in its own context.
If more than one Plugin should receive the piped value, wrap them in parentheses:
<ul class="some-ui-element" data-jetjs-plugins="childCount | (updateClass, updateText) , parralax, imgZoom"
In this case the updateClass and the updateText plugin will receive the value from the childCount Plugin.
Nesting and pipes inside parentheses are not supported: data-jetjs-plugins="childCount | (multiplyBy | updateText) , parralax, imgZoom
<ul class="some-ui-element" data-jetjs-plugins="childCount | updateClass" data-jetjs-update-something-class-prefix="item-list-">
<li />
<li />
<li />
<li />
</ul>
Plugins can use results from previous Plugins. To make the example above work, the childCount Plugin must return a value:
window.jetjs.plugins.childCount = (element, options) => {
return element.childElementCount;
}
and the updateSomething Plugin must accept an optional value parameter:
window.jetjs.plugins.updateSomething = (element, options, value) => {
element.classList.add(options.classPrefix + "" + value);
}
After Execution the class item-list-4 is added to the elemnt:
<ul class="some-ui-element item-list-4" data-jetjs-plugins="childCount | updateClass" data-jetjs-update-something-class-prefix="item-list-">
<li />
<li />
<li />
<li />
</ul>
If the value is not dynamic, you can define a fixed value. Any value, that can not be find as Plugin, will used as fixed value.
<ul class="some-ui-element item-list-4" data-jetjs-plugins=" 3 | updateClass" data-jetjs-update-something-class-prefix="item-list-">
<li />
<li />
<li />
<li />
</ul>
But as in unix, pipes can't only work with one single value.
the childCount Plugin can change the value as often as needed.
window.jetjs.plugins.childCount = (element, options) => {
window.setTimeout(() => {
this.value(NEW_VALUE);
}, 3000);
// use the simple API for initial value
return element.childElementCount;
}
Plugins can listen to these new values:
window.jetjs.plugins.updateSomething = (element, options, initialValue) => {
this.onValueChange((newValue) => {
}, false); // pass false to ignore the initial value
element.classList.add(options.classPrefix + "" + value);
}
Bring your own CSS. JS should focus on behavior, not on component styling. But often a little bit of CSS is needed. e.g. positioning, animation.
For that, plugins should use inline styles. They don't provide an external css file!
TBD:
Yes, but they are technically the same. They only differ logically:
YES! Just build it :-)
Just include at the bottom of your body Tag.
If you want to optimize caching. You can use the file with the hash defined: jet.[hash].js
...
<body>
...
<script async data-jetjs="true" src="/jet.js"></script>
</body>
jet will be loaded and start executing plugins... IF you need to pass some options, just do it, as you do for Plugins:
...
<body>
...
<script async data-jetjs="true" src="/jet.js" data-jetjs-foo="bar" ></script>
</body>
Possible options:
data-<prefix>-<plugin name> defaults to "jetjs" resulting in data attributes like data-jetjs-<plugin name>. Cannot be changed for the jet.js itself.Yes, it can! just write a small wrapper plugin, to call the desired library the Jet.js way :-) ... or simply use it without Jet.js integration.
jQuery Plugins can be executed from Jet.js. but they must be defined via the jquery widget factory or like the following:
/**
* @param options it is important,
* that only one param will be accepted as options
*/
$.fn.<plugin name> = function (options) {
return this.each(() => { ... });
}
to make all jquery Plugins available to jet.js, include jet-jquery-bridge.js in your site.
jet-jquery-bridge.js exports all plugins to jquery:
if ($.fn.<plugin name>) {
console.error(<plugin name>, " already defined as jQuery Plugin.");
}
$.fn.<plugin name> = (options) => {
return this.each((element) => {
window.jetjs.plugins.<plugin name>.apply(null, element.get(0), options);
})
}
but make sure, you don't get naming conflicts...
/**
* @param element = Element the plugin was executed on
* @param options = user defined options (via data attributes), never null or undefined. But can be an empty Object {}
* @param value = (optional) value, that can be passed via Pipes
*/
window.jetjs.plugins.<plugin name> = function(element, options, value) {
// Do what you want ...
};
<plugin name> should be defined in camelCase.
Reuseable plugins, which will be published on npm should be named like jetjs-plugin-name-plugin (kebab-case).
after jet.js is loaded, its instace is accessible via window.jetjs.
To change the namespace, you have to build jet.js by your own.
Just change the moduleName property inside the rollup.config.js file.
TODO: define Matrix... create nice image How to test Browser support?
IE: >= 11 Edge, Chrome, Firefox, Safari, Opera, IOS Safari, Chrome for Android
TODO:
HTTP 2 Push via firebase: https://firebase.googleblog.com/2016/09/http2-comes-to-firebase-hosting.html
HTTP 2 with NodeJS and Express: https://webapplog.com/http2-server-push-node-express/
Tutorial, how to write / use an AppShell Architecture with Jet.js
Using Rollup
Using Webpack
Using Browserify
Create an Issue ...
You can also contribute through source code. Just start with an issue that is marked as "ready for development"
This project uses standard code style, so everything stay consistent.
We use SemVer for versioning. For the versions available, see the releases on this repository.
See also the list of contributors who participated in this project.
This project is licensed under the Apache-2.0 License - see the LICENSE file for details
FAQs
Jet.js is a simple JavaScript plugin execution library for simple websites.
We found that jet-js 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.