{"id":15645989,"url":"https://github.com/alii/permer","last_synced_at":"2025-07-18T19:03:03.525Z","repository":{"id":42009124,"uuid":"314289812","full_name":"alii/permer","owner":"alii","description":"🔑 A basic abstraction for handling flags using bitwise","archived":false,"fork":false,"pushed_at":"2022-06-23T16:55:59.000Z","size":901,"stargazers_count":52,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-24T07:42:58.471Z","etag":null,"topics":["bitwise","permissions"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/permer","language":"TypeScript","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/alii.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":"2020-11-19T15:30:19.000Z","updated_at":"2024-12-02T02:12:50.000Z","dependencies_parsed_at":"2022-08-12T02:11:06.920Z","dependency_job_id":null,"html_url":"https://github.com/alii/permer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alii/permer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alii%2Fpermer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alii%2Fpermer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alii%2Fpermer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alii%2Fpermer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alii","download_url":"https://codeload.github.com/alii/permer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alii%2Fpermer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265814493,"owners_count":23832716,"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":["bitwise","permissions"],"created_at":"2024-10-03T12:10:54.120Z","updated_at":"2025-07-18T19:03:03.472Z","avatar_url":"https://github.com/alii.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Permer\n\n### A basic abstraction for handling flags and permissions using bitwise\n\n#### Install\n\n`yarn add permer` or, with npm `npm i --save permer`\n\n#### Example\n\n```ts\nimport {Permer} from 'permer';\n\nconst permer = new Permer(['read', 'write', 'admin', 'owner', 'staff']);\n\nconst user = {\n\tpermissions: permer.calculate(['read', 'write', 'admin']),\n\tusername: 'alii',\n};\n\n// Get individual permissions\nconst isAdmin = permer.test(user.permissions, 'admin');\nconst isOwner = permer.test(user.permissions, 'owner');\nconst isStaff = permer.test(user.permissions, 'staff');\nconst canRead = permer.test(user.permissions, 'read');\nconst canWrite = permer.test(user.permissions, 'write');\n\nconsole.log(`${user.username}'s permissions:`, {\n\tisAdmin,\n\tisOwner,\n\tisStaff,\n\tcanRead,\n\tcanWrite,\n});\n\n// Get an array of all permissions\nconst availablePermissions = permer.list(user.permissions).join(', ');\nconsole.log(`${user.username}'s permission list:`, availablePermissions);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falii%2Fpermer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falii%2Fpermer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falii%2Fpermer/lists"}