{"id":21807420,"url":"https://github.com/beingofexistence13/hack","last_synced_at":"2026-05-11T06:19:01.253Z","repository":{"id":200701272,"uuid":"706100029","full_name":"beingofexistence13/hack","owner":"beingofexistence13","description":"Welcome to hack, a repository dedicated to creating a secure login and logout system. Our code ensures user data privacy. We invite contributions to enhance our system. Let’s make user authentication smooth and secure together!","archived":false,"fork":false,"pushed_at":"2023-10-21T01:13:49.000Z","size":14614,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T04:43:12.578Z","etag":null,"topics":["alchemy","apple","google","meta","microsoft","moralis","openai","thirdweb","vercel"],"latest_commit_sha":null,"homepage":"https://dx-emon-beingofexistence-shohan.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beingofexistence13.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-10-17T09:55:14.000Z","updated_at":"2023-10-21T00:54:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"87d5f619-bc79-4dfa-bb44-808df233c549","html_url":"https://github.com/beingofexistence13/hack","commit_stats":null,"previous_names":["beingofexistence/hack","beingofexistence13/hack"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beingofexistence13%2Fhack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beingofexistence13%2Fhack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beingofexistence13%2Fhack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beingofexistence13%2Fhack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beingofexistence13","download_url":"https://codeload.github.com/beingofexistence13/hack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244759961,"owners_count":20505716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alchemy","apple","google","meta","microsoft","moralis","openai","thirdweb","vercel"],"created_at":"2024-11-27T12:40:49.844Z","updated_at":"2026-05-11T06:18:56.197Z","avatar_url":"https://github.com/beingofexistence13.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Hack**\n\n**Solve all your logging and logout problems** 🔐\n\nHack is an open source library that makes it easy to implement secure logging and logout functionality in your web applications. It provides a variety of features, including:\n\n* User authentication and authorization\n* Session management\n* Password hashing and salting\n* Logging and auditing\n* CSRF protection\n* Logout prevention\n\nHack is designed to be easy to use and integrate with existing applications. It is also highly extensible, so you can customize it to meet your specific needs.\n\n**Getting started**\n\nTo get started with Hack, simply install the package:\n\n```\nnpm install hack\n```\nYou can also install the library using pip:\n\n```bash\npip install hack\n```\n\nOr you can clone the repo and install it from source:\n\n```bash\ngit clone https://github.com/your_username/hack.git\ncd hack\npython setup.py install\n```\n\nOnce Hack is installed, you can create a new user account:\n\n```\nconst hack = require('hack');\n\nconst user = await hack.createUser({\n  username: 'my_username',\n  password: 'my_password',\n});\n```\n\nOnce you have a user account, you can log them in:\n\n```\nconst token = await hack.login(user);\n```\n\nYou can then use the token to authenticate the user and access their account data.\n\nTo log the user out, simply call the `logout()` function:\n\n```\nhack.logout();\n```\n## Features\n- Easy to use: just import the library and start logging with one line of code.\n- Customizable: you can configure the log level, format, handler, and output destination.\n- Flexible: you can create multiple loggers with different settings and use them in different modules.\n- Reliable: you can handle exceptions and errors gracefully and log them with stack traces.\n- Compatible: you can use the library with any Python version from 2.7 to 3.9.\n\n## Usage\nTo use the library, you need to import it and create a logger object:\n\n```python\nimport hack\nlogger = hack.Logger()\n```\n\nThen you can use the logger methods to log messages with different levels:\n\n```python\nlogger.debug(\"This is a debug message\")\nlogger.info(\"This is an info message\")\nlogger.warning(\"This is a warning message\")\nlogger.error(\"This is an error message\")\nlogger.critical(\"This is a critical message\")\n```\n\nBy default, the messages will be printed to the standard output (console) with the following format:\n\n```\n[2023-10-21 01:05:22] [DEBUG] This is a debug message\n[2023-10-21 01:05:22] [INFO] This is an info message\n[2023-10-21 01:05:22] [WARNING] This is a warning message\n[2023-10-21 01:05:22] [ERROR] This is an error message\n[2023-10-21 01:05:22] [CRITICAL] This is a critical message\n```\n\nThe format consists of four parts: the timestamp, the log level, the module name, and the message. You can customize the format by passing a string to the `format` parameter when creating the logger object:\n\n```python\nlogger = hack.Logger(format=\"%(message)s\")\n```\n\nThe string can contain any of the following placeholders:\n\n| Placeholder | Description |\n| ----------- | ----------- |\n| %(asctime)s | The date and time of the log event |\n| %(levelname)s | The name of the log level |\n| %(module)s | The name of the module where the log event occurred |\n| %(message)s | The log message |\n\nYou can also change the log level by passing a string or an integer to the `level` parameter when creating the logger object:\n\n```python\nlogger = hack.Logger(level=\"INFO\")\n```\n\nThe valid log levels are:\n\n| Level | Value |\n| ----- | ----- |\n| DEBUG | 10 |\n| INFO | 20 |\n| WARNING | 30 |\n| ERROR | 40 |\n| CRITICAL | 50 |\n\nThe logger will only log messages that have a level equal or higher than the specified level. For example, if you set the level to \"INFO\", then only messages with \"INFO\", \"WARNING\", \"ERROR\", and \"CRITICAL\" levels will be logged.\n\nYou can also specify a different output destination for the log messages by passing a file object or a file name to the `output` parameter when creating the logger object:\n\n```python\nlogger = hack.Logger(output=\"log.txt\")\n```\n\nThis will write the log messages to a file named \"log.txt\" in the current directory. You can also use any file-like object that supports writing, such as `sys.stdout` or `sys.stderr`.\n\nIf you want to use more than one output destination, you can use the `add_handler` method to add additional handlers to the logger object:\n\n```python\nlogger.add_handler(hack.FileHandler(\"log.txt\"))\nlogger.add_handler(hack.StreamHandler(sys.stderr))\n```\n\nA handler is an object that receives log messages from a logger and writes them to a specific destination. The library provides two built-in handlers: `FileHandler` and `StreamHandler`. You can also create your own custom handlers by subclassing the `BaseHandler` class and overriding its `write` method.\n\nIf you want to remove a handler from the logger object, you can use the `remove_handler` method:\n\n```python\nlogger.remove_handler(handler)\n```\n\nYou need to pass the handler object that you want to remove as an argument.\n\nIf you want to handle exceptions and errors in your code and log them with stack traces, you can use the `exception` method of the logger object:\n\n```python\ntry:\n    # some code that may raise an exception\nexcept Exception as e:\n    logger.exception(e)\n```\n\nThis will log the exception message and the stack trace with the \"ERROR\" level. You can also pass a custom message as an optional argument:\n\n```python\nlogger.exception(e, \"Something went wrong\")\n```\n\nThis will log the custom message followed by the exception message and the stack trace.\n\n## Documentation\nYou can find the full documentation of the library [here].\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE] file for details.\n\n## Contributing\nWe welcome contributions from anyone who wants to improve this project. Please follow these steps to contribute:\n\n- Fork the repo and create your branch from `master`.\n- Make your changes and write tests if necessary.\n- Run the tests and check the code style with `pytest` and `flake8`.\n- Commit your changes and push to your branch.\n- Create a pull request and describe your changes.\n\n## Contact\nIf you have any questions, suggestions, or feedback, please feel free to contact us at hack@hack.com.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeingofexistence13%2Fhack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeingofexistence13%2Fhack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeingofexistence13%2Fhack/lists"}