perman
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

stars license supportServer forks issues

Logo

Perman.JS

🔑 Permission management made easy
Get support »

Report Bug · Request Feature · Webpage

🔑 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

Package Sidebar

Install

npm i perman

Weekly Downloads

4

Version

1.0.3

License

GPL-3.0

Unpacked Size

62.6 kB

Total Files

7

Last publish

Collaborators

  • leydihavuc
  • ben_baris