New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@fed1/jsos

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fed1/jsos

WARNING: DO NOT USE! This library does not have a stable release yet.

latest
npmnpm
Version
1.0.0-preview.11
Version published
Maintainers
1
Created
Source

JS Object System (JSOS)

WARNING: DO NOT USE! This library does not have a stable release yet.

JSOS enables you to write type-safe, extensible JavaScript without a compiler.

It accomplishes this goal using type-based multiple dispatch and a reified type system.

This library is gratis and open source, licensed under the MIT No Attribution License (MIT-0).

Features

  • Multimethods inspired by Common Lisp
    • Type-based dispatch
    • Class-based dispatch
    • Trait-based dispatch
    • Structual (deep equality) dispatch¹
    • Predicate dispatch¹
    • Qualified methods: around, before, after
    • Method combinators: progn, list, pipe, plus, custom
    • "Call next method" support
    • Contracts to enforce input and output types
  • Type system inspired by Julia
    • Abstract types with multiple inheritance
    • Parametric struct types
    • Dependent types
    • Type unions and intersections
  • Traits inspired by Rust
    • Traits that bundle multimethods
    • Can be implemented by types and other traits
  • Typed alternatives to JS's Array, Map, Set
    • Immutable by default
    • Mutable versions are observable
    • Adds covariant tuples

¹: Optional, can be enabled on a per-multimethod basis

See examples in the docs to get a feel for how these features work together.

Installation

npm i @fed1/jsos

Documentation

You can find the documentation at:

https://jsos.fed1.org

To help edit the documentation, checkout the docs branch and read the README there.

Contributing

We welcome your ideas, bug reports, and contributions. Please read the CONTRIBUTING.md file if you want to get involved.

FAQs

Package last updated on 24 Mar 2025

Did you know?

Socket

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.

Install

Related posts