Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/barbarbar338/perman.js

πŸ”‘ Permission management made easy
https://github.com/barbarbar338/perman.js

bin binary bit bits bitwise flag flags perm permission permissions

Last synced: 6 days ago
JSON representation

πŸ”‘ Permission management made easy

Awesome Lists containing this project

README

        

[![stars](https://img.shields.io/github/stars/barbarbar338/perman.js?color=yellow&logo=github&style=for-the-badge)](https://github.com/barbarbar338/perman)
[![license](https://img.shields.io/github/license/barbarbar338/perman.js?logo=github&style=for-the-badge)](https://github.com/barbarbar338/perman.js)
[![supportServer](https://img.shields.io/discord/711995199945179187?color=7289DA&label=Support&logo=discord&style=for-the-badge)](https://discord.gg/BjEJFwh)
[![forks](https://img.shields.io/github/forks/barbarbar338/perman.js?color=green&logo=github&style=for-the-badge)](https://github.com/barbarbar338/perman.js)
[![issues](https://img.shields.io/github/issues/barbarbar338/perman.js?color=red&logo=github&style=for-the-badge)](https://github.com/barbarbar338/perman.js)


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

```js
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İ](https://github.com/barbarbar338).

Distributed under the [GPL-3.0](https://www.gnu.org/licenses/gpl-3.0.html) 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

- Mail: [email protected]
- Discord: https://discord.gg/BjEJFwh
- Webpage: https://338.rocks