{"id":19986403,"url":"https://github.com/sourcec0de/lib-loader","last_synced_at":"2026-06-11T10:31:38.652Z","repository":{"id":147151780,"uuid":"27500191","full_name":"sourcec0de/lib-loader","owner":"sourcec0de","description":"load and cache libraries and configs using the require system for easy access","archived":false,"fork":false,"pushed_at":"2015-04-29T18:25:54.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T20:42:07.605Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcec0de.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":"2014-12-03T18:01:16.000Z","updated_at":"2015-04-29T18:25:54.000Z","dependencies_parsed_at":"2023-03-29T00:43:11.491Z","dependency_job_id":null,"html_url":"https://github.com/sourcec0de/lib-loader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sourcec0de/lib-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcec0de%2Flib-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcec0de%2Flib-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcec0de%2Flib-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcec0de%2Flib-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcec0de","download_url":"https://codeload.github.com/sourcec0de/lib-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcec0de%2Flib-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34195112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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":[],"created_at":"2024-11-13T04:29:03.073Z","updated_at":"2026-06-11T10:31:38.634Z","avatar_url":"https://github.com/sourcec0de.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"loadz\n==========\n\nThis is a small module for making library and config loading 100x easier but mostly just less verbose.\n\n\n#### Cache your libs\nThis is an example library structure\n```\n|_ index.js\n|_ libRunning.js\n|_ systemLib/\n    |_ settings.json\n    |_ awesome_system_module/\n        |_ index.js\n```\n\nPlace this statment where ever you want to first cache your library. You can only call this once per library otherwise you will recieve an error.\n```js\n// index.js\nrequire('loadz').load({\n    // this is the directory your library files reside\n    libDir: './systemLib', // defaults to process.cwd()+'/lib'\n\n    // this is the key the library will be cached under\n    libKey: 'system', // defaults to 'lib'\n});\n```\n\n\n#### Use your libraries\nYou can access your cached libraries by using this statment. Notice I use the `.system` attribute. This is determined by the value we place in `libKey`.\nAll files and folders are `required` and cached under `require('loadz')` for easy access.\n\n```js\n// libRunning.js\nvar system = require('loadz').system;\nsystem.settings // equivalent to the return of require('./systemLib/settings.json')\nsystem.awesome_system_module // equivalent to the return of require('./systemLib/awesome_system_module/index.js');\n```\n\n\n#### Load many libraries\nIf you are like me you may have several libraries to load.\n\n```js\nrequire('loadz').loadMany([\n    { libDir: 'systemLib',  libKey: 'system' },\n    { libDir: 'webLib',     libKey: 'web' },\n    { libDir: 'systemLib2', libKey: 'system2' }\n]);\n```\n\n#### Exluding files\nExclude files using globs checkout [minimatch][1] for what is possible.\n```js\nrequire('loadz').load({\n    libDir: './lib',\n    libKey: 'lib',\n    exclude: [\n        '*.json',\n        'iDontWantToLoadThis.js'\n    ]\n});\n```\n\nCheckout the `tests` directory for a real example.\n\n[1]: https://www.npmjs.org/package/minimatch","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcec0de%2Flib-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcec0de%2Flib-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcec0de%2Flib-loader/lists"}