{"id":23326171,"url":"https://github.com/phelsen/funcl","last_synced_at":"2026-05-13T12:38:02.467Z","repository":{"id":57242903,"uuid":"182139645","full_name":"phelsen/funcl","owner":"phelsen","description":"A functional library very heavily inspired by clojure","archived":false,"fork":false,"pushed_at":"2020-06-25T09:57:19.000Z","size":52,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-27T15:49:24.603Z","etag":null,"topics":["clojure","functional","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phelsen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-18T18:40:03.000Z","updated_at":"2022-11-25T21:48:21.000Z","dependencies_parsed_at":"2022-09-15T01:33:44.245Z","dependency_job_id":null,"html_url":"https://github.com/phelsen/funcl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phelsen/funcl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phelsen%2Ffuncl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phelsen%2Ffuncl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phelsen%2Ffuncl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phelsen%2Ffuncl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phelsen","download_url":"https://codeload.github.com/phelsen/funcl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phelsen%2Ffuncl/sbom","scorecard":{"id":730840,"data":{"date":"2025-08-11","repo":{"name":"github.com/phelsen/funcl","commit":"26018e4717a12c7ed1e4601db454cc929f9eb4f5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/29 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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T14:21:59.638Z","repository_id":57242903,"created_at":"2025-08-22T14:21:59.639Z","updated_at":"2025-08-22T14:21:59.639Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281295816,"owners_count":26476759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["clojure","functional","javascript"],"created_at":"2024-12-20T19:14:42.593Z","updated_at":"2025-10-27T15:49:25.090Z","avatar_url":"https://github.com/phelsen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FunCl\n[![LICENSE MIT](https://img.shields.io/npm/l/funcl.svg)](https://www.npmjs.com/package/funcl)\n\n\nSome javascript util functions that sure as hell ring a clojure bell!\n\nhttps://phelsen.github.io/funcl/\n\nNOTE: funcl is still in alpha phase.\n(However : functions that allready have an exact clojure signature will continue to do so)\n\n## Get it \n\nYou can install the latest release via npm:\n\n```shell\nnpm i -S funcl\n```\n\nand use it with Node or a bundler like webpack or browserify  : \n\n```javascript\nf = require('funcl');\n// or \nimport f from  'funcl'; \n```\n\n\n## Test it \n\n```shell\nnpm run test\n```\n\n## Understand it\n\nThe main goal of this library is to make programming in javascript easier, more fun and less error-prone. Not to mimic clojure 100%. \nAlthough an effort has been/will be made to stay close to the clojure api : this library will always choose pragmatism over 'puritanism'. \nFunCl is not supporting lazy collections, nor will it try to copy the behaviour of macro's. \nAt the other side, functions that seem convenient will be added even though clojure might not offer them. \n\nAs an example of the effort towards pragmatism : in this library most functions that lack some of their arguments will return the partial function that makes most sense. \nThat way the very convenient pipe() function can do its magic kinda intuitively. \n\n\n```javascript\npipe(range(100),drop(80),reverse,takeWhile(x =\u003e x\u003e90),filter(isOdd),map(inc))\n=\u003e[100,98,96,94,92]\n```\n\n\nAPI documentation is a work in progress :  https://phelsen.github.io/funcl/\n\n\n## Do it (some quick examples)\n| Code | Result |\n| --- | --- |\n|everything=range(1e4); life=pipe(range(1,50),filter(isMultipleOf(6))); theUniverse=filter(isMultipleOf(7),range(1e4)); intersection(life,theUniverse,everything)|[42]|\n|sum(filter(isAnyOf(isMultipleOf(3),isMultipleOf(5)),range(1e3))) // https://projecteuler.net/problem=1|233168|\n|arr=range(1,11); arr|[1,2,3,4,5,6,7,8,9,10]|\n|count(arr)|10|\n|reverse(arr)|[10,9,8,7,6,5,4,3,2,1]|\n|count('λλ FUNCL! λλ') |12|\n|reverse('λλ FUNCL! λλ' )|\"λλ !LCNUF λλ\"|\n|[first(arr), last(arr)]|[10,1]|\n|rest(arr)|[9,8,7,6,5,4,3,2,1]|\n|takeWhile(x =\u003e x \u003c 5, arr)|[]|\n|takeLast(3, arr)|[3,2,1]|\n|map(sqr,arr)|[100,81,64,49,36,25,16,9,4,1]|\n|partition(2,interleave([1,2,3],[4,5,6]))|[[1,4],[2,5],[3,6]]|\n|pipe(arr,map(sqr),reverse,map(x=\u003ex+100),filter(isOdd))|[101,109,125,149,181]|\n|dict=assoc({}, 'fn' , 'Bar' , 'ln', 'Foo')|{\"fn\":\"Bar\",\"ln\":\"Foo\"}|\n|map(type, [arr,dict,11,true,{},[],new Date(),/funcl/])|[\"array\",\"map\",\"number\",\"boolean\",\"map\",\"array\",\"date\",\"regexp\"]|\n|dict=pipe(dict,assoc('ln', 'StillFoo', 'address',{ street : 'FunclStreet' , nb :  '12' }));|{\"fn\":\"Bar\",\"ln\":\"StillFoo\",\"address\":{\"street\":\"FunclStreet\",\"nb\":\"12\"}}|\n|dict2=clone(dict)|{\"fn\":\"Bar\",\"ln\":\"StillFoo\",\"address\":{\"street\":\"FunclStreet\",\"nb\":\"12\"}}|\n|eq(dict,dict2)|true|\n|dict2=assoc(dict2,'nickname','funky' )|{\"fn\":\"Bar\",\"ln\":\"StillFoo\",\"address\":{\"street\":\"FunclStreet\",\"nb\":\"12\"},\"nickname\":\"funky\"}|\n|eq(dict,dict2)|false|","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphelsen%2Ffuncl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphelsen%2Ffuncl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphelsen%2Ffuncl/lists"}