memorio 0.0.9 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ New minor (feature) releases of this app/software are released every six months and
4
+ patch (bugfix) releases are released every month. More information on the
5
+ release cycle: see package.json
6
+
7
+ ## Previous
8
+
9
+ Please see the git history for the details of previous versions.
10
+ You can see HISTORY.md for all information.
package/CITATION.cff ADDED
@@ -0,0 +1,24 @@
1
+ # This CITATION.cff file was generated with cffinit.
2
+ # Visit https://bit.ly/cffinit to generate yours today!
3
+
4
+ cff-version: 1.2.0
5
+ title: memorio
6
+ message: memorio by Dario Passariello
7
+ type: software
8
+ authors:
9
+ - given-names: "Dario "
10
+ family-names: Passariello
11
+ email: dariopassariello@gmail.com
12
+ abstract: >-
13
+ memorio.State and Store Management are now easy, accessible
14
+ everywhere in your application.
15
+ keywords:
16
+ - memorio
17
+ - development
18
+ - toolset
19
+ - state
20
+ - store
21
+ - observer
22
+ - dario
23
+ - passariello
24
+ license: MIT
@@ -0,0 +1,108 @@
1
+ # Code of Conduct - memorio
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to make participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to a positive environment for our
15
+ community include:
16
+
17
+ * Demonstrating empathy and kindness toward other people
18
+ * Being respectful of differing opinions, viewpoints, and experiences
19
+ * Giving and gracefully accepting constructive feedback
20
+ * Accepting responsibility and apologizing to those affected by our mistakes,
21
+ and learning from the experience
22
+ * Focusing on what is best not just for us as individuals, but for the
23
+ overall community
24
+
25
+ Examples of unacceptable behavior include:
26
+
27
+ * The use of sexualized language or imagery, and sexual attention or advances
28
+ * Trolling, insulting or derogatory comments, and personal or political attacks
29
+ * Public or private harassment
30
+ * Publishing others' private information, such as a physical or email
31
+ address, without their explicit permission
32
+ * Other conduct which could reasonably be considered inappropriate in a
33
+ professional setting
34
+
35
+ ## Our Responsibilities
36
+
37
+ Project maintainers are responsible for clarifying and enforcing our standards of
38
+ acceptable behavior and will take appropriate and fair corrective action in
39
+ response to any behavior that they deem inappropriate,
40
+ threatening, offensive, or harmful.
41
+
42
+ Project maintainers have the right and responsibility to remove, edit, or reject
43
+ comments, commits, code, wiki edits, issues, and other contributions that are
44
+ not aligned to this Code of Conduct, and will
45
+ communicate reasons for moderation decisions when appropriate.
46
+
47
+ ## Scope
48
+
49
+ This Code of Conduct applies within all community spaces, and also applies when
50
+ an individual is officially representing the community in public spaces.
51
+ Examples of representing our community include using an official e-mail address,
52
+ posting via an official social media account, or acting as an appointed
53
+ representative at an online or offline event.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported to the community leaders responsible for enforcement at <dariopassariello@gmail.com>.
59
+ All complaints will be reviewed and investigated promptly and fairly.
60
+
61
+ All community leaders are obligated to respect the privacy and security of the
62
+ reporter of any incident.
63
+
64
+ ## Enforcement Guidelines
65
+
66
+ Community leaders will follow these Community Impact Guidelines in determining
67
+ the consequences for any action they deem in violation of this Code of Conduct:
68
+
69
+ ### 1. Correction
70
+
71
+ **Community Impact**: Use of inappropriate language or other behavior deemed
72
+ unprofessional or unwelcome in the community.
73
+
74
+ **Consequence**: A private, written warning from community leaders, providing
75
+ clarity around the nature of the violation and an explanation of why the
76
+ behavior was inappropriate. A public apology may be requested.
77
+
78
+ ### 2. Warning
79
+
80
+ **Community Impact**: A violation through a single incident or series
81
+ of actions.
82
+
83
+ **Consequence**: A warning with consequences for continued behavior. No
84
+ interaction with the people involved, including unsolicited interaction with
85
+ those enforcing the Code of Conduct, for a specified period of time. This
86
+ includes avoiding interactions in community spaces as well as external channels
87
+ like social media. Violating these terms may lead to a temporary or
88
+ permanent ban.
89
+
90
+ ### 3. Temporary Ban
91
+
92
+ **Community Impact**: A serious violation of community standards, including
93
+ sustained inappropriate behavior.
94
+
95
+ **Consequence**: A temporary ban from any sort of interaction or public
96
+ communication with the community for a specified period of time. No public or
97
+ private interaction with the people involved, including unsolicited interaction
98
+ with those enforcing the Code of Conduct, is allowed during this period.
99
+ Violating these terms may lead to a permanent ban.
100
+
101
+ ### 4. Permanent Ban
102
+
103
+ **Community Impact**: Demonstrating a pattern of violation of community
104
+ standards, including sustained inappropriate behavior, harassment of an
105
+ individual, or aggression toward or disparagement of classes of individuals.
106
+
107
+ **Consequence**: A permanent ban from any sort of public interaction within
108
+ the community.
@@ -0,0 +1,108 @@
1
+ # Contributing
2
+
3
+ First off, thanks for taking the time to contribute!
4
+
5
+ All types of contributions are encouraged and valued. See the [Table of Contents](contributing.md#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions.
6
+
7
+ > And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
8
+ >
9
+ > * Star the project
10
+ > * Tweet about it
11
+ > * Refer this project in your project's readme
12
+ > * Mention the project at local meetups and tell your friends/colleagues
13
+
14
+ ## Table of Contents
15
+
16
+ * [Code of Conduct](contributing.md#code-of-conduct)
17
+ * [I Have a Question](contributing.md#i-have-a-question)
18
+ * [I Want To Contribute](contributing.md#i-want-to-contribute)
19
+ * [Reporting Bugs](contributing.md#reporting-bugs)
20
+ * [Suggesting Enhancements](contributing.md#suggesting-enhancements)
21
+ * [Your First Code Contribution](contributing.md#your-first-code-contribution)
22
+ * [Improving The Documentation](contributing.md#improving-the-documentation)
23
+ * [Style guides](contributing.md#styleguides)
24
+ * [Commit Messages](contributing.md#commit-messages)
25
+ * [Join The Project Team](contributing.md#join-the-project-team)
26
+
27
+ ## Code of Conduct
28
+
29
+ This project and everyone participating in it is governed by the [memorio Code of Conduct](https://github.com/a51-dev/a51.memorio.public/blob/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [dariopassariello@gmail.com](mailto:dariopassariello@gmail.com).
30
+
31
+ ## I Have a Question
32
+
33
+ > If you want to ask a question, we assume that you have read the available [Documentation](https://a51.gitbook.io/memorio/).
34
+
35
+ Before you ask a question, it is best to search for existing [Issues](https://github.com/a51-dev/a51.memorio.public/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.
36
+
37
+ If you then still feel the need to ask a question and need clarification, we recommend the following:
38
+
39
+ * Open an [Issue](https://github.com/a51-dev/a51.memorio.public/issues/new).
40
+ * Provide as much context as you can about what you're running into.
41
+ * Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.
42
+
43
+ We will then take care of the issue as soon as possible.
44
+
45
+ ## I Want To Contribute
46
+
47
+ > ### Legal Notice
48
+ >
49
+ > When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
50
+
51
+ ### Reporting Bugs
52
+
53
+ #### Before Submitting a Bug Report
54
+
55
+ A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
56
+
57
+ * Make sure that you are using the latest version.
58
+ * Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://a51.gitbook.io/memorio/). If you are looking for support, you might want to check [this section](contributing.md#i-have-a-question)).
59
+ * To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/a51-dev/a51.memorio.public/issues?q=label%3Abug).
60
+ * Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
61
+ * Collect information about the bug:
62
+ * Stack trace (Traceback)
63
+ * OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
64
+ * Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
65
+ * Possibly your input and the output
66
+ * Can you reliably reproduce the issue? And can you also reproduce it with older versions?
67
+
68
+ #### How Do I Submit a Good Bug Report?
69
+
70
+ > You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to [dariopassariello@gmail.com](mailto:dariopassariello@gmail.com).
71
+
72
+ We use GitHub issues to track bugs and errors. If you run into an issue with the project:
73
+
74
+ * Open an [Issue](https://github.com/a51-dev/a51.memorio.public/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
75
+ * Explain the behavior you would expect and the actual behavior.
76
+ * Please provide as much context as possible and describe the _reproduction steps_ that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
77
+ * Provide the information you collected in the previous section.
78
+
79
+ Once it's filed:
80
+
81
+ * The project team will label the issue accordingly.
82
+ * A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced.
83
+ * If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](contributing.md#your-first-code-contribution).
84
+
85
+ ### Suggesting Enhancements
86
+
87
+ This section guides you through submitting an enhancement suggestion for memorio, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
88
+
89
+ #### Before Submitting an Enhancement
90
+
91
+ * Make sure that you are using the latest version.
92
+ * Read the [documentation](https://a51.gitbook.io/memorio/) carefully and find out if the functionality is already covered, maybe by an individual configuration.
93
+ * Perform a [search](https://github.com/a51-dev/a51.memorio.public/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
94
+ * Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.
95
+
96
+ #### How Do I Submit a Good Enhancement Suggestion?
97
+
98
+ Enhancement suggestions are tracked as [GitHub issues](https://github.com/a51-dev/a51.memorio.public/issues).
99
+
100
+ * Use a **clear and descriptive title** for the issue to identify the suggestion.
101
+ * Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
102
+ * **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
103
+ * You may want to **include screenshots or screen recordings** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [screentogif](https://www.screentogif.com/) to record GIFs on macOS and Windows, and the built-in [screen recorder in GNOME](https://help.gnome.org/users/gnome-help/stable/screen-shot-record.html.en) or [SimpleScreenRecorder](https://github.com/MaartenBaert/ssr) on Linux.
104
+ * **Explain why this enhancement would be useful** to most boilerplate users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
105
+
106
+ ## Join The Project Team
107
+
108
+ Please send email to <dariopassariello@gmail.com>
package/FUNDING.yml ADDED
@@ -0,0 +1,16 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: passariello
4
+ patreon: passariello
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: passariello
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: passariello
10
+ issuehunt: passariello
11
+ otechie: # Replace with a single Otechie username
12
+ custom:
13
+ [
14
+ "https://dario.passariello.ca",
15
+ "https://www.indiegogo.com/individuals/28513718",
16
+ ]
package/HISTORY.md ADDED
@@ -0,0 +1 @@
1
+ None
package/README.md CHANGED
@@ -1,3 +1,51 @@
1
1
  # Memorio
2
2
 
3
3
  Memory management for State and Store in easy way
4
+
5
+ ## STATE
6
+
7
+ ```js
8
+ // Set a state
9
+ state.test = "I am ready" *
10
+
11
+ // Get the state
12
+ state.test *
13
+
14
+ // List all states
15
+ state.list // or just "state" to see the proxy
16
+
17
+ // Lock a state from edit (Only for Objects or Array)
18
+ state.test.lock() *
19
+
20
+ // Remove a state
21
+ state.remove("test")
22
+
23
+ // Remove all states
24
+ state.removeAll()
25
+
26
+ *["test" is only an example]
27
+
28
+ ```
29
+
30
+ ## STORE
31
+
32
+ ```js
33
+ // Set a store:
34
+ store.set("test", { test: "test" })
35
+
36
+ // Get a store:
37
+ store.get("test") // Output: { test: "test" }
38
+
39
+ // Remove a store:
40
+ store.remove("test") // Output: "ok"
41
+
42
+ // Remove all stores:
43
+ store.removeAll() // Output: "ok"
44
+ ```
45
+
46
+ ```js
47
+ // Observe state changes
48
+ observer('myData', () => {
49
+ console.log('myData has changed to:', state.myData);
50
+ });
51
+ ```
package/SUMMARY.md ADDED
@@ -0,0 +1,21 @@
1
+ # Table of contents
2
+
3
+ * [README](README.md)
4
+
5
+ ## General
6
+
7
+ * [State](/documents/STATE.md)
8
+ * [Observer](/documents/OBSERVER.md)
9
+ * [Store](/documents/STORE.md)
10
+
11
+ ## documents
12
+
13
+ * [License](LICENSE.md)
14
+ * [Contributing](CONTRIBUTING.md)
15
+ * [Code of Conduct](CODE_OF_CONDUCT.md)
16
+ * [Security](SECURITY.md)
17
+
18
+ ## changes
19
+
20
+ * [Changelog](CAHNGELOG.md)
21
+ * [History](HISTORY.md)
@@ -0,0 +1,72 @@
1
+ # Observer
2
+
3
+ ## Overview
4
+
5
+ This document provides a comprehensive list of all available observer functions in the `memorio` library along with their descriptions and examples.
6
+
7
+ ## Functions
8
+
9
+ ### observer([state.name], [function])
10
+
11
+ - **Description:** Sets up an observer to monitor state changes and trigger a callback.
12
+ - **Parameters:**
13
+ - `stateName` (string): The name of the state to monitor.
14
+ - `callBack` (Function): The callback function to run when the state changes.
15
+ - `option` (object): Additional options for the observer.
16
+
17
+ - **Example:**
18
+
19
+ ```javascript
20
+ observer('state.test', (newValue) => {
21
+ console.log('State changed:', newValue);
22
+ });
23
+ ```
24
+
25
+ ### observer([state.name])
26
+
27
+ - **Description:** Recall the observer previously generated.
28
+ - **Returns:** Console log with a note
29
+
30
+ - **Example:**
31
+
32
+ ```javascript
33
+ observer('state.test');
34
+ ```
35
+
36
+ ### observer.list
37
+
38
+ - **Description:** See the list of all your observer (eventListener) actually installed.
39
+ - **Returns:** The list of all installed observers.
40
+
41
+ - **Example:**
42
+
43
+ ```javascript
44
+ observer.list;
45
+ ```
46
+
47
+ ### remove
48
+
49
+ - **Description:** Remove an observer.
50
+ - **Parameters:**
51
+ - `name` (string): The name of the observer to remove.
52
+
53
+ - **Example:**
54
+
55
+ ```javascript
56
+ observer.remove('state.test');
57
+ ```
58
+
59
+ ### removeAll
60
+
61
+ - **Description:** Remove all observers.
62
+ - **Returns:** void
63
+
64
+ - **Example:**
65
+
66
+ ```javascript
67
+ observer.removeAll();
68
+ ```
69
+
70
+ ## License
71
+
72
+ This project is licensed under the MIT License.
@@ -0,0 +1,72 @@
1
+ # memorio State
2
+
3
+ ## Overview
4
+
5
+ This document provides a comprehensive list of all available state functions in the `memorio` library along with their descriptions and examples.
6
+
7
+ ## Functions
8
+
9
+ ### state.[state.name] ex: _state.test_
10
+
11
+ - **Description:** Set and get state values.
12
+
13
+ - **Example:**
14
+
15
+ ```javascript
16
+ // To set a state value
17
+ state.name = 'value';
18
+
19
+ // To get a state value
20
+ const value = state.name;
21
+ ```
22
+
23
+ ### state.list
24
+
25
+ - **Description:** Show all states out of proxy.
26
+
27
+ - **Example:**
28
+
29
+ ```javascript
30
+ state.list;
31
+ ```
32
+
33
+ ### state.remove([state.name])
34
+
35
+ - **Description:** Remove a state.
36
+ - **Parameters:**
37
+ - `name` (string): The name of the state to remove.
38
+
39
+ - **Example:**
40
+
41
+ ```javascript
42
+ state.remove('stateName');
43
+ ```
44
+
45
+ ### state.name.lock()
46
+
47
+ - **Description:** Lock a state (only for types: Array, Object).
48
+
49
+ - **Example:**
50
+
51
+ ```javascript
52
+ state.name = {test:"test"}
53
+ state.name.lock();
54
+ "Now you can't add more data or remove it"
55
+ ```
56
+
57
+ ### state.removeAll()
58
+
59
+ - **Description:** Remove all states.
60
+
61
+ - **Example:**
62
+
63
+ ```javascript
64
+ state.name = {test:"test"}
65
+ state.removeAll();
66
+ "Now you can't see state.name (all states are removed)"
67
+ "Use for Log-out / Sign-out operation"
68
+ ```
69
+
70
+ ## License
71
+
72
+ This project is licensed under the MIT License.
@@ -0,0 +1,84 @@
1
+ # memorio Store
2
+
3
+ ## Overview
4
+
5
+ This document provides a comprehensive list of all available store functions in the `memorio` library along with their descriptions and examples.
6
+
7
+ ## Functions
8
+
9
+ ### store.get([store.name])
10
+
11
+ - **Description:** Retrieve an item from local storage.
12
+ - **Parameters:**
13
+ - `name` (string): The name of the item to retrieve.
14
+
15
+ - **Example:**
16
+
17
+ ```javascript
18
+ const value = store.get('itemName');
19
+ console.log(value);
20
+ ```
21
+
22
+ ### store.set([name, value])
23
+
24
+ - **Description:** Set an item in local storage.
25
+ - **Parameters:**
26
+ - `name` (string): The name of the item to set.
27
+ - `value` (any): The value of the item to set.
28
+
29
+ - **Example:**
30
+
31
+ ```javascript
32
+ store.set('itemName', value);
33
+ ```
34
+
35
+ ### store.remove([store.name])
36
+
37
+ - **Description:** Delete an item from local storage.
38
+ - **Parameters:**
39
+ - `name` (string): The name of the item to delete.
40
+
41
+ - **Example:**
42
+
43
+ ```javascript
44
+ store.remove('itemName');
45
+ ```
46
+
47
+ ### store.removeAll()
48
+
49
+ - **Description:** Remove all items from local storage.
50
+ - **Parameters:** None
51
+
52
+ - **Example:**
53
+
54
+ ```javascript
55
+ store.removeAll();
56
+ ```
57
+
58
+ ### store.quota()
59
+
60
+ - **Description:** Estimate the storage quota and usage.
61
+ - **Parameters:** None
62
+
63
+ - **Example:**
64
+
65
+ ```javascript
66
+ const quota = store.quota();
67
+ console.log(quota);
68
+ ```
69
+
70
+ ### store.size()
71
+
72
+ - **Description:** Calculate the total size of all items in local storage.
73
+ - **Parameters:** None
74
+
75
+ - **Example:**
76
+
77
+ ```javascript
78
+ const totalSize = store.size();
79
+ console.log(totalSize);
80
+ ```
81
+
82
+ ## License
83
+
84
+ This project is licensed under the MIT License.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memorio",
3
- "version": "0.0.9",
3
+ "version": "0.1.0",
4
4
  "description": "memorio",
5
5
  "copyright": "Dario Passariello",
6
6
  "license": "MIT",