
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
This project is currently on development and testing. so any ideas are welcome at this state while the API is being designed and tested.
you know that later you cant break things that easily.
Argon is a very simple abstraction over data
[Model] -> [RequestObject] -> [Storage1] -> Processors -> ? (This could be anything) -> Preprocessors
-> [Storage2]
So in a sense is a Model Abstraction but does not try to provide all the database features, its just takes care of the data inside the language. The features can be used or not (that is up to you), because in some cases it makes sense to use validations but not in others, or maybe you could use a database or maybe a page or even just a simple hash, the idea is that you get the same API for this things.
Argon does not optimize for networking because its not its problem, neither tries to expose an API for a certain query language, you could say that Js is your query language so do anything that you like.
It is built using Neon and this dictates some of the syntactic look and feel but i have my reasons for do it and basically is because I have some other tools on Neon that help the project and avoids trying to implement a bunch of features that do not belong here.
//Neon Class
Class('Model')({});
//Argon Model for a Ram based local Storage
Class('Model').includes(Argon.Model)({
storage : new Argon.Storage.Local()
});
API
Model includes CustomEventSupport ValidationSupport
storage <<Ar.Storage>>
find(id, callback)
all(callback)
prototype
getProperty(propertyName)
setProperty(propertyName, value) -> dispatches change:propertyName
save(callback) -> runs validations, dispatches create|save event
destroy(callback) -> dispatches destroy event
Storage
processors
preprocessors
prototype
storage
processors
preprocessors
create(requestObject, callback)
find(requestObject, callback)
findOne(requestObject, callback)
update(requestObject, callback)
remove(requestObject, callback)
ValidationSupport
validations
prototype
errors
isValid
There are a bunch of examples on the spec folder because argon is tested (whatever that means), at least the examples there run, and those are the use cases that the library is supposed to support.
but here is a simple one
Class(Todo.Model, 'Task').includes(Argon.Model, Argon.Association)({
storage : new Argon.Storage.Local(),
validations : {
labelIsRequired : {
validate : function () {
return this.hasOwnProperty('label')
&& typeof this.label === 'string'
&& this.label !== ''
},
message : 'label is required and must be a non empty string'
}
}
});
Todo.Model.Task.hasOne({
name : 'image',
targetModel : 'Todo.Model.Image',
targetProperty : 'taskId'
});
Todo.Model.Task.all(function (tasks) {
console.log(tasks.length);
});
FAQs
Active Record for EcmaScript
The npm package argonjs receives a total of 7 weekly downloads. As such, argonjs popularity was classified as not popular.
We found that argonjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.