{"id":15547297,"url":"https://github.com/uhop/meta-toolkit","last_synced_at":"2026-02-18T14:04:45.239Z","repository":{"id":252704153,"uuid":"841193914","full_name":"uhop/meta-toolkit","owner":"uhop","description":"Toolkit to help with meta programming and OOP","archived":false,"fork":false,"pushed_at":"2026-02-08T01:37:23.000Z","size":71,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-08T09:45:04.094Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uhop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"uhop","buy_me_a_coffee":"uhop"}},"created_at":"2024-08-11T22:15:30.000Z","updated_at":"2026-02-08T01:36:58.000Z","dependencies_parsed_at":"2024-08-22T03:03:23.410Z","dependency_job_id":"064a9d6c-0b5e-468c-93e7-41dd401847d9","html_url":"https://github.com/uhop/meta-toolkit","commit_stats":{"total_commits":38,"total_committers":1,"mean_commits":38.0,"dds":0.0,"last_synced_commit":"6be0e1a3174dbef9c3793b13ec48d33745af125a"},"previous_names":["uhop/meta-toolkit"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/uhop/meta-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uhop%2Fmeta-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uhop%2Fmeta-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uhop%2Fmeta-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uhop%2Fmeta-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uhop","download_url":"https://codeload.github.com/uhop/meta-toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uhop%2Fmeta-toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29581546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T13:56:48.962Z","status":"ssl_error","status_checked_at":"2026-02-18T13:54:34.145Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2024-10-02T13:08:34.818Z","updated_at":"2026-02-18T14:04:45.234Z","avatar_url":"https://github.com/uhop.png","language":"JavaScript","readme":"# Meta toolkit [![NPM version][npm-img]][npm-url]\n\n[npm-img]: https://img.shields.io/npm/v/meta-toolkit.svg\n[npm-url]: https://npmjs.org/package/meta-toolkit\n\nMeta toolkit is a toolkit to help with meta programming and OOP. It is a no-dependency,\nno-nonsense collection of small bits my projects accumulated over the years. They deal with\nhelping to generate classes, objects, prototypes, iterators, and more.\n\n* Name mangling (`meta-toolkit/names.js`) provides a conversion from compound names\n  such as `foo-bar` to `['foo', 'bar']` and from `['foo', 'bar']` to `fooBar` and vice versa.\n  * Used to generated file names, method names, and so on.\n  * The following naming schemas are supported out of box:\n    * `camelCase` \u0026mdash; `toCamelCase()`, `fromCamelCase()`.\n    * `PascalCase` \u0026mdash; `toPascalCase()`, `fromPascalCase()`.\n    * `snake_case` \u0026mdash; `toSnakeCase()`, `fromSnakeCase()`.\n      * `SNAKE_CASE` \u0026mdash; `toAllCapsSnakeCase()`.\n    * `kebab-case` \u0026mdash; `toKebabCase()`, `fromKebabCase()`.\n* Descriptor manipulation (`meta-toolkit/descriptors.js`) provides a set of helpers used to generate\n  various accessors dynamically and share them between different objects/prototypes:\n  * Create descriptors \u0026mdash; `makeGetter()`, `makeSetter()`, `makeAccessors()`.\n  * Add descriptors \u0026mdash; `addDescriptor()`, `addDescriptors()`, `addAccessor()`, `addGetters()`.\n  * Copy descriptors \u0026mdash; `copyDescriptors()`.\n* Aliases (`meta-toolkit/aliases.js`) provides a set of helpers to alias existing properties:\n  * Alias properties \u0026mdash; `addAlias()`, `addAliases()`.\n* Prototypes (`meta-toolkit/prototypes.js`) provides a set of helpers to inspect prototypes:\n  * Iterate over prototypes \u0026mdash; `prototypes()`.\n  * `getPropertyDescriptor()` \u0026mdash; similar to `getOwnPropertyDescriptor()`, but for all prototypes\n    not just the current object.\n* Iterators (`meta-toolkit/iterators.js`) provides a set of helpers simplify creating custom iterators:\n  * Augment iterable with an iterator interface \u0026mdash; `augmentIterator()`, `normalizeIterator()`.\n  * Add array-like methods if not present \u0026mdash; `mapIterator()`, `filterIterator()`.\n* Path (`meta-toolkit/path.js`) provides a set of helpers to work with embedded objects in a simple way:\n  * Get value from a nested object by path \u0026mdash; `get()`.\n  * Set value in a nested object by path \u0026mdash; `set()`.\n* Options (`meta-toolkit/options.js`) provides a set of helpers to organize options for constructors:\n  * Copy options according to some defaults \u0026mdash; `copyOptions()`.\n* Comparators (`meta-toolkit/comparators.js`) provides a set of helpers to convert between different\n  types of comparator functions:\n  * Create a compare function from a less function and vice versa \u0026mdash; `compareFromLess()`,\n    `lessFromCompare()`.\n  * Create an equality function from a less function \u0026mdash; `equalFromLess()`.\n  * Reverse comparators \u0026mdash; `reverseCompare()`, `reverseLess()`.\n\nSee the full documentation in the [wiki](https://github.com/uhop/meta-toolkit/wiki).\n\n## Examples\n\nGenerating names:\n\n```js\nimport {toCamelCase, toPascalCase, toSnakeCase,\n  toAllCapsSnakeCase, fromKebabCase} from 'meta-toolkit/names.js';\n\nconst names = fromKebabCase('foo-bar-baz');\n\nconsole.log(toCamelCase(names));        // fooBarBaz\nconsole.log(toPascalCase(names));       // FooBarBaz\nconsole.log(toSnakeCase(names));        // foo_bar_baz\nconsole.log(toAllCapsSnakeCase(names)); // FOO_BAR_BAZ\n```\n\nAliasing properties:\n\n```js\nimport {addAliases} from 'meta-toolkit/aliases.js';\n\nclass Foo {\n  constructor() { this.value = 0; }\n  get double() { return this.value * 2; }\n  line(a, b) { return a * this.value + b; }\n}\naddAliases(Foo.prototype, {\n  double: 'x2, duplicate',\n  line: 'linear'\n});\n\nconst f = new Foo(2);\n\nconsole.log(f.double);       // 4\nconsole.log(f.x2);           // 4\nconsole.log(f.linear(1, 2)); // 4\n```\n\nObject manipulation with paths:\n\n```js\nimport {set, get, remove, forceSet} from 'meta-toolkit/path.js';\n\nconst object = {};\n\nforceSet(object, 'a.b.c', 1); // object = {a: {b: {c: 1}}}\n\nget(object, 'a.b.c');         // 1\nget(object, 'a');             // {b: {c: 1}}\n\nset(object, 'a.b.c', 2);      // object = {a: {b: {c: 2}}}\nset(object, 'a.b.d', 3);      // object = {a: {b: {c: 2, d: 3}}}\n\nremove(object, 'a.b.c');      // object = {a: {b: {d: 3}}}\nremove(object, 'a.b');        // object = {a: {}}\n```\n\n## License\n\nBSD 3-Clause \"New\" or \"Revised\" License. See the LICENSE file for details.\n\n## Release History\n\n* 1.1.6 *Updated dev dependencies.*\n* 1.1.5 *Updated dev dependencies.*\n* 1.1.4 *Updated dev dependencies.*\n* 1.1.3 *Technical release: added `types` to `package.json`.*\n* 1.1.2 *Added TS types.*\n* 1.1.1 *Updated deps.*\n* 1.1.0 *Added comparator utilities.*\n* 1.0.0 *Initial release.*\n","funding_links":["https://github.com/sponsors/uhop","https://buymeacoffee.com/uhop"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuhop%2Fmeta-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuhop%2Fmeta-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuhop%2Fmeta-toolkit/lists"}