{"id":25861764,"url":"https://github.com/quartercastle/autoloader","last_synced_at":"2025-03-01T23:45:21.245Z","repository":{"id":57161910,"uuid":"56787967","full_name":"quartercastle/autoloader","owner":"quartercastle","description":"Autoload modules and json files in Node.js","archived":false,"fork":false,"pushed_at":"2017-10-12T21:27:14.000Z","size":125,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T11:08:42.901Z","etag":null,"topics":["autoloader","js","json","modules","nodejs","specla"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quartercastle.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":"2016-04-21T16:07:53.000Z","updated_at":"2023-01-19T00:57:58.000Z","dependencies_parsed_at":"2022-08-23T19:40:37.090Z","dependency_job_id":null,"html_url":"https://github.com/quartercastle/autoloader","commit_stats":null,"previous_names":["specla/autoloader"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quartercastle%2Fautoloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quartercastle%2Fautoloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quartercastle%2Fautoloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quartercastle%2Fautoloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quartercastle","download_url":"https://codeload.github.com/quartercastle/autoloader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241439487,"owners_count":19963097,"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":["autoloader","js","json","modules","nodejs","specla"],"created_at":"2025-03-01T23:45:20.406Z","updated_at":"2025-03-01T23:45:21.239Z","avatar_url":"https://github.com/quartercastle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Specla Autoloader\n\n[![npm version](https://img.shields.io/npm/v/specla-autoloader.svg)](https://www.npmjs.com/package/specla-autoloader)\n[![Build Status](https://travis-ci.org/specla/autoloader.svg?branch=master)](https://travis-ci.org/specla/autoloader)\n[![Coverage Status](https://coveralls.io/repos/github/specla/autoloader/badge.svg?branch=release-1.0)](https://coveralls.io/github/specla/autoloader?branch=release-1.0)\n[![Dependency Status](https://david-dm.org/specla/autoloader.svg)](https://david-dm.org/specla/autoloader)\n[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n\nAutoload `modules` and `json` files with ease. This packages constructs an object\nthat reflects your folder structure and requires the files within the\nspecified path.\n\n### Install\n```sh\nnpm install --save @specla/autoloader\n```\n\n### Usage\n```js\nconst path = require('path')\nconst Autoloader = require('@specla/autoloader')\n\nconst modules = new Autoloader(path.resolve('./modules'))\n```\n\nAn example of the path `./modules` could look like this.\n```\n┬ modules\n├── some-file.js\n├── data.json\n├─┬ sub-modules\n  ├── other-file.js\n```\n\nThis will create the following js object when the path is autoloaded.\n```js\nconst modules = {\n  'some-file': require('./modules/some-file.js'),\n  data: require('./modules/data.json'),\n  'sub-modules': {\n    'other-file': require('./modules/sub-modules/other-file.js')\n  }\n}\n```\n\n### Options\n```js\nconst modules = new Autoloader(__dirname, {\n  include: ['js', 'json'], // specifies which file types to include\n  ignore: [\n    'node_modules', // ignore folders\n    'some-file.js' // ignore specific file\n  ]\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquartercastle%2Fautoloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquartercastle%2Fautoloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquartercastle%2Fautoloader/lists"}