perman
v1.2.0
Published
🔑 Permission management made easy
Downloads
40
Readme
🔑 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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/my-feature
) - Run prettier (
npm run format
) - Commit your Changes (
git commit -m 'my awesome feature my-feature'
) - Push to the Branch (
git push origin feature/my-feature
) - Open a Pull Request
🔥 Show your support
Give a ⭐️ if this project helped you!
📞 Contact
- Mail: [email protected]
- Discord: https://discord.gg/BjEJFwh
- Webpage: https://338.rocks