{"id":15366881,"url":"https://github.com/cupcakearmy/memiens","last_synced_at":"2026-04-18T05:34:08.289Z","repository":{"id":34291481,"uuid":"174697367","full_name":"cupcakearmy/memiens","owner":"cupcakearmy","description":"YAML Settings","archived":false,"fork":false,"pushed_at":"2022-03-15T11:40:46.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T23:38:52.005Z","etag":null,"topics":["configuration","settings","settings-storage","yaml"],"latest_commit_sha":null,"homepage":null,"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/cupcakearmy.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":"2019-03-09T13:23:07.000Z","updated_at":"2022-03-15T11:39:57.000Z","dependencies_parsed_at":"2022-08-08T00:15:31.617Z","dependency_job_id":null,"html_url":"https://github.com/cupcakearmy/memiens","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cupcakearmy/memiens","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cupcakearmy%2Fmemiens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cupcakearmy%2Fmemiens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cupcakearmy%2Fmemiens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cupcakearmy%2Fmemiens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cupcakearmy","download_url":"https://codeload.github.com/cupcakearmy/memiens/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cupcakearmy%2Fmemiens/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31957660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["configuration","settings","settings-storage","yaml"],"created_at":"2024-10-01T13:20:08.433Z","updated_at":"2026-04-18T05:34:08.269Z","avatar_url":"https://github.com/cupcakearmy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Memiens 🧠\n\nYAML Settings utility. Nested getter with optional default value and a setter.\n\n**Typescript typings included**\n\n## Quickstart 🚀\n\n```\nnpm i -s memiens\n```\n\n```typescript\nimport Memiens from 'memiens'\n\n// Initialize by giving a location for the config file.\nconst MySettings = new Memiens('./config.yml')\n\n// This will throw an error if `someconfigvalue` is not found in the yaml\nconst A = MySettings.get('someconfigvalue')\n\n// This will not throw an error if `B` is not found\nconst B = MySettings.get('B', 'this value is returned and written to the yaml if the config entry does not exist')\n\n// This will look for nested values inside the yaml\nconst C = MySettings.get('my.nested.config.value')\n\n// Write something\nMySettings.set('password', 'this is a secret')\n// Nested \nMySettings.set('config.db.user', 'my_db_user')\nMySettings.set('config.db.port', 1234)\n```\n\n## API 📒\n\n### `.get(setting, default [optional])`\n\n###### Behavior\nSettings can be simple or nested properties.\nIf a default value is not provided it will throw an error in case the value is not set. Otherwise the default value will be written into the yaml and returned to the user.\n\n###### Examples\n\n\n```yaml\n# test.yml\n\ndb:\n    user: myUser\n    password: $ecr3t\n    port: 1234\n\nsimple: a string\n```\n\n```typescript\nimport Memiens from 'memiens'\nconst Settings = new Memiens('./test.yml')\n\nconst simple = Settings.get('simple') // 'a string'\nconst db = Settings.get('db') // {user: 'myUser', ...}\nconst user = Settings.get('db.user') // 'myUser'\n\nSettings.get('db').user === Settings.get('db.user') // true\n\nSettings.get('notfound') // throws Error\nSettings.get('notfound', 404) // Sets 'notfound' to 404 and returns 404\n```\n\n### `.set(setting, value)`\n\n###### Behavior\nSettings can be simple or nested properties.\nValues can be `string`, `number`, `boolean` or a nested object of those\n\n###### Examples\n\n\n```typescript\nimport Memiens from 'memiens'\nconst Settings = new Memiens('./result.yml')\n\nconst config = {\n\ta: true,\n\tdb: {\n\t\tuser: 'myUser',\n\t\tpassword: '$ecr3t',\n\t\tport: 1234,\n\t}\n}\n\nSettings.set('a', config.a)\nSettings.set('db', config.db)\n```\n\n```yaml\n# result.yml\n\na: true\ndb:\n    user: myUser\n    password: $ecr3t\n    port: 1234\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcupcakearmy%2Fmemiens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcupcakearmy%2Fmemiens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcupcakearmy%2Fmemiens/lists"}