
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
conditioner-js
Advanced tools
ConditionerJS is a JavaScript library for loading and unloading behavior based on the current user context.
Load a Google Map module only if the screen is wider than 40em and the HTML element has been seen by the user.
<a href="http://maps.google.com/?ll=51.741,3.822"
data-module="ui/Map"
data-conditions="media:{(min-width:40em)} and element:{was visible}"> ... </a>
When the module has loaded ConditionerJS will automatically unload it once the conditions are no longer valid (for instance when the user resizes the viewport).
The documentation and a selection of demos can be found at conditionerjs.com
npm install conditioner-js
bower install conditioner-js
Add the conditioner.js file (found in the dist/dev folder) to your project. You'll also have to add the monitors and utilities folder. The dev version of the conditioner framework includes logging statements, the dist/min folder contains a minimized version without these statements to limit file size.
Run gulp test to spin up the test suite.
Conditioner expects an AMD loader to be available. It's been tested with RequireJS, Almond and Curl. As long as your AMD loader follows the AMD spec it should be fine.
If you're not into AMD and prefer Browserify that's fine too but keep in mind that your optimized file should contain all modules. If you want the best of both worlds you might be interested in WebPack.
.on method to addConditionMonitor and .is method to matchesCondition.removeConditionMonitor.is/matchesCondition method did not clean up Promisesupported property has been added which is used to determine if a module can be loaded at allgetModule method APIwas statement to make tests sticky element:{was visible}.data-options=“map.zoom:10, map.type:terrain”.getModule and getModules methods to access moduleControllers more directly.is and on methods for manually testing conditions once or continually.destroy method to destroy previously initialised nodes.Read the 1.0.0 closed issue list for a complete overview.
Always interested in your opinion, please let me know on Twitter or contact met via hello@rikschennink.nl
FAQs
ConditionerJS - Frizz Free, Environment-aware, JavaScript Modules
We found that conditioner-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
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.