1.0.3 • Published 7 months ago

perman v1.0.3

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
7 months ago

stars license supportServer forks issues

🔑 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