{"id":15286899,"url":"https://github.com/delonnewman/atomjs","last_synced_at":"2026-02-06T12:39:51.437Z","repository":{"id":57107399,"uuid":"236887234","full_name":"delonnewman/atomjs","owner":"delonnewman","description":"Clojure Atoms for Javascript. Shared, synchronous, independent state. A fork of https://github.com/cjohansen/js-atom.","archived":false,"fork":false,"pushed_at":"2022-05-05T19:13:21.000Z","size":300,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-02T00:19:04.331Z","etag":null,"topics":["atom","clojure","concurrency","concurrent-programming","functional","functional-programming","javascript","javascript-library","state","synchronous"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/delonnewman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-29T02:21:29.000Z","updated_at":"2022-05-05T19:13:25.000Z","dependencies_parsed_at":"2022-08-20T17:11:19.250Z","dependency_job_id":null,"html_url":"https://github.com/delonnewman/atomjs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/delonnewman/atomjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delonnewman%2Fatomjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delonnewman%2Fatomjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delonnewman%2Fatomjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delonnewman%2Fatomjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delonnewman","download_url":"https://codeload.github.com/delonnewman/atomjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delonnewman%2Fatomjs/sbom","scorecard":{"id":333200,"data":{"date":"2025-08-11","repo":{"name":"github.com/delonnewman/atomjs","commit":"729620ae27ee7b22c005f23c85a719d5705b3065"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/delonnewman/atomjs/nodejs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/delonnewman/atomjs/nodejs.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:21","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T04:04:32.993Z","repository_id":57107399,"created_at":"2025-08-18T04:04:32.994Z","updated_at":"2025-08-18T04:04:32.994Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29160819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T07:18:23.844Z","status":"ssl_error","status_checked_at":"2026-02-06T07:13:32.659Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atom","clojure","concurrency","concurrent-programming","functional","functional-programming","javascript","javascript-library","state","synchronous"],"created_at":"2024-09-30T15:18:54.490Z","updated_at":"2026-02-06T12:39:51.417Z","avatar_url":"https://github.com/delonnewman.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/delonnewman"],"categories":[],"sub_categories":[],"readme":"![Node.js CI](https://github.com/delonnewman/atomjs/workflows/Node.js%20CI/badge.svg)\n![npm](https://img.shields.io/npm/v/@delonnewman/atom)\n\n# Atom.js\n\nShared, synchronous, independent state--Clojure Atoms for Javascript. A fork of [js-atom](https://github.com/cjohansen/js-atom).\n\n# Rational\n\nImmutable values require some sort of external state management in order for\nyour app to change state. One option is to use variables in scope to hold the\ncurrent state of your app:\n\n```js\nfunction startApp(root) {\n    var data;\n\n    function render() {\n        React.renderComponent(AppUI(data), root);\n    }\n\n    pollForData(function (newData) {\n        data = newData;\n        render();\n    });\n\n    // ...\n}\n```\n\nThis sort of works, but quickly becomes unwieldy. Atoms offer a formal mechanism\nfor maintaining a single mutable reference. An atom is used to hold the current\nstate. It offers a small API for changing (or replacing) this state, subscribing\nto changes, and for validating state changes.\n\n```js\nfunction startApp(root) {\n    var state = atom({});\n\n    function render() {\n        React.renderComponent(AppUI(state.deref()), root);\n    }\n\n    // Render when the state changes\n    state.addWatch(\"poll-update\", render);\n\n    pollForNewData(function (newData) {\n        state.reset(newData);\n    });\n\n    // ...\n}\n```\n\n# Immutability\n\nAtoms are most useful when containing immutable values, but there's nothing\nstopping you from sticking whatever you want in them. If you put a mutable value\nin the atom, you either have to make sure you don't actually mutate it, or lose\nsome of the benefits (e.g. being able to trust past versions of the state).\n\n# API\n\nThe API is designed to mirror Clojure's atoms as closely as possible. Because\natoms are references, and not values, I didn't see any problems with defining\nthe API as methods on the atom object.\n\n## atom(val[, options])\n\nCreates a new atom wrapping the provided value. `options` is optional, and\ncurrently only supports one option: `validator`:\n\n```js\nvar atom = require(\"atom\");\nvar ref = atom([], { validator: Array.isArray });\n\natom.reset([1, 2, 3]); // OK\natom.reset({}); // Throws exception\n```\n\n\n## atom.isAtom(val)\n\nReturns true if `val` is an atom instance otherwise returns false.\n\n\n## atom#deref() \n\n(aliased as `atom.deref(value)`)\n\nReturns the contained value.\n\n\n## atom#reset(val)\n\nReplace the current state with a new value\n\n\n## atom#swap(fn[, ...])\n\nUpdate the state by applying the function to the current value, and setting the\nreturn value as the new value of the atom. Any additional arguments are passed\nto the function as well, after the atom value, e.g.: `atom.swap(fn, 1, 2, 3)`\nwill replace the current value with what is returned from\n`fn(atomValue, 1, 2, 3)`.\n\n## atom#compareAndSet(oldValue, newValue)\n\nAtomically sets the value of atom to newval if and only if the\ncurrent value of the atom is identical to oldval. Returns true if\nset happened, else false.\n\n## atom#addWatch(key, function (key, ref, old, new) {})\n\nAdd a function that will be called whenever the atom value changes. The key is\njust a string identifying this watcher - it can be used to remove the watcher\nagain. The callback is called with four arguments whenever the state changes\n(e.g. with `reset` or `swap`):\n\n- `key` - The key used to register the watcher\n- `ref` - The atom reference\n- `old` - The previous value\n- `new` - The new value\n\n\n## atom#removeWatch(key)\n\nRemoves the previously added watcher.\n\n## atom#toString\n\nPrints a useful string representation of the contents of the atom.\n\nLicense\n=======\n\nCopyright © 2014, 2019 Christian Johansen, Delon Newman.\n\nSee [LICENSE](LICENSE)\n\n# Support\n\n\u003ca href=\"https://www.buymeacoffee.com/delonnewman\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelonnewman%2Fatomjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelonnewman%2Fatomjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelonnewman%2Fatomjs/lists"}