{"id":24594294,"url":"https://github.com/nilern/js-idiomatic-symbols","last_synced_at":"2025-07-18T13:32:38.067Z","repository":{"id":21199319,"uuid":"24511012","full_name":"nilern/js-idiomatic-symbols","owner":"nilern","description":"Transform Clojure naming conventions to those of JavaScript.","archived":false,"fork":false,"pushed_at":"2015-01-25T11:33:34.000Z","size":140,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-30T21:02:24.317Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nilern.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":"2014-09-26T18:37:49.000Z","updated_at":"2019-08-13T15:51:38.000Z","dependencies_parsed_at":"2022-08-28T05:40:42.488Z","dependency_job_id":null,"html_url":"https://github.com/nilern/js-idiomatic-symbols","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nilern/js-idiomatic-symbols","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilern%2Fjs-idiomatic-symbols","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilern%2Fjs-idiomatic-symbols/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilern%2Fjs-idiomatic-symbols/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilern%2Fjs-idiomatic-symbols/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nilern","download_url":"https://codeload.github.com/nilern/js-idiomatic-symbols/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilern%2Fjs-idiomatic-symbols/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265768429,"owners_count":23825122,"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","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":[],"created_at":"2025-01-24T11:14:17.974Z","updated_at":"2025-07-18T13:32:37.947Z","avatar_url":"https://github.com/nilern.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"js-idiomatic-symbols\n====================\n\n_Transform Clojure naming conventions to those of JavaScript._\n\nMore precisely, these transformations:\n\n```clojurescript\n  dash-delimited                   ;=\u003e dashDelimited\n  set!                             ;=\u003e set\n  *dynamic*                        ;=\u003e dynamic\n  **private**                      ;=\u003e __private__\n  all-humans-are-created=and-free  ;=\u003e allHumansAreCreatedEqualAndFree\n  apples+oranges                   ;=\u003e applesPlusOranges\n  even?                            ;=\u003e isEven\n  rope-\u003estr                        ;=\u003e ropeToStr\n  rope\u003c-str                        ;=\u003e ropeFromStr\n```\n\nRationale\n---------\n\nUsing Clojure/Lisp symbol names in ClojureScript but exporting them as \nidiomatic JavaScript symbols feels like the Right Thing. It also felt a bit\ntedious, so I created this little library.\n\nUsage\n-----\n\nAdd the following entry to your project.clj `:dependencies` vector:\n\n![Clojars Project](http://clojars.org/js-idiomatic-symbols/latest-version.svg)\n\nThen, in your code, you can do these things:\n\n```clojurescript\n(ns js-friendly\n  (:require [js-idiomatic-symbols.core :as jsid])\n  (:require-macros [js-idiomatic-symbols.macros :as jsidm]))\n\n;; Of course, the whole thing is based on messing with strings...\n(jsid/js-idiomatize-str \"this\u003c-me-\u003eyou?!\") ;=\u003e \"isThisFromMeToYou\"\n\n;; ... but symbol manipulation is more important:\n(jsid/js-idiomatize-sym 'this\u003c-me-\u003eyou?!) ;=\u003e 'isThisFromMeToYou\n\n;; You might ensure js-formatted names up front:\n(jsidm/defjs-idiomatic this\u003c-me-\u003eyou?! \"Love, love, love.\")\nisThisFromMeToYou ;=\u003e \"Love, love, love.\"\nthis\u003c-me-\u003eyou?! ; note that this will not be defined at all\n\n;; Or you might just write normal ClojureScript\n(def not-\u003edisencourage \"But it's NOT so easy.\")\n\n;;; ...\n\n;; ... and then define additional symbols for the public (JavaScript) API:\n(jsidm/defjs-idiomatic-export not-\u003edisencourage)\nnotToDisencourage ;=\u003e \"But it's NOT so easy.\"\n\n;;; Both macros also add the ^:export metadata for you.\n```\n\nAnd that's all there is to this.\n\nAcknowledgements\n----------------\n\nThe inspiration for this project can be largely attributed to \n[Gozala](https://github.com/Gozala)'s [Wisp](https://github.com/Gozala/wisp). \nSpecifically, [this part](https://github.com/Gozala/wisp#conventions).\n\nLicense\n-------\n\nCopyright © 2014 Pauli Jaakkola\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilern%2Fjs-idiomatic-symbols","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnilern%2Fjs-idiomatic-symbols","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilern%2Fjs-idiomatic-symbols/lists"}