
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
/** example/simple.js
declare is a node.js optimized version of dojo 1.7's dojo.declare This example shows how to create a namespace and create classes within.
No global namespace is violated
declare includes the folloing modified dojo functions
for more information check the dojo docs (with dojo. prefix for sure)
**/
var createNamespace = require("../index");
var myCustomNamespace = { "doesNotMatter" : "anyValue" };
var oop = createNamespace(myCustomNamespace);
var MYClass = oop.declare("my.namespace.MYCLASS",[],{ property:"value", constructor:function(){ console.log("I AM ALIVE"); }, methodA:function(){ console.log("methodA called") console.log(this); }, methodB:function(){ console.log("methodB called") } });
oop.declare("MYSubClass",[myCustomNamespace.my.namespace.MYCLASS],{ constructor:function(){ oop.mixin(this,{methodC:function(){ console.log("same mixin like known from dojo @" , this.declaredClass); }}); }, methodA:function(){ console.log("method A from " + this.declaredClass); } })
/* this will end up with the same result... / var instance = new MYClass(); / The namespace can be accessed with the object we used to create the "oop" instance. You could create more factories each with a different namespace */ var i2 = new myCustomNamespace.my.namespace.MYCLASS();
var subi = new myCustomNamespace.MYSubClass(); subi.methodA(); subi.methodB(); subi.methodC();
I AM ALIVE I AM ALIVE I AM ALIVE method A from MYSubClass methodB called same mixin like known from dojo @ MYSubClass **/
FAQs
dojo 1.7 based oop utils
The npm package declare receives a total of 51 weekly downloads. As such, declare popularity was classified as not popular.
We found that declare 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.