Skip to content

Latest commit

History

History
87 lines (64 loc) 路 2.92 KB

README.md

File metadata and controls

87 lines (64 loc) 路 2.92 KB

stars license supportServer forks issues

Logo

Perman.JS

馃攽 Permission management made easy
Get support 禄

Report BugRequest FeatureWebpage

馃攽 Perman

Permission management made easy

馃摝 Installation

  • Using yarn: yarn add perman
  • Using npm: npm i perman

馃 Usage

import { Perman } from "perman";

const perman = Perman.from(["user", "verified", "admin"]);

const user = perman.serialize(["user"]);
const verified = perman.serialize(["user", "verified"]);
const admin = perman.serialize(["user", "admin"]);

user.has("user"); // true
user.has("admin"); // false;
verified.has("verified"); // true;
verified.has("admin"); // false;
admin.has("admin"); // true;

// add permissions
user.has("verified"); // false;
user = user.add("verified");
user.has("verified"); // true;

// remove permissions
verified.has("verified"); // true;
verified = verified.remove("verified");
verified.has("verified"); // false;

馃搫 License

Copyright 漏 2022 Bar谋艧 DEM陌RC陌.

Distributed under the GPL-3.0 License. See LICENSE for more information.

馃Е Contributing

Fell free to use GitHub's features.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/my-feature)
  3. Run prettier (npm run format)
  4. Commit your Changes (git commit -m 'my awesome feature my-feature')
  5. Push to the Branch (git push origin feature/my-feature)
  6. Open a Pull Request

馃敟 Show your support

Give a 猸愶笍 if this project helped you!

馃摓 Contact