{"id":18774086,"url":"https://github.com/ephellon/synq","last_synced_at":"2025-12-14T05:30:12.377Z","repository":{"id":84333835,"uuid":"129583402","full_name":"Ephellon/SynQ","owner":"Ephellon","description":"SynQ.js - local storage caching/syncing system.","archived":false,"fork":false,"pushed_at":"2019-10-19T04:54:32.000Z","size":160,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-29T08:42:16.236Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ephellon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-15T06:27:59.000Z","updated_at":"2019-12-18T15:43:42.000Z","dependencies_parsed_at":"2023-03-12T22:24:07.855Z","dependency_job_id":null,"html_url":"https://github.com/Ephellon/SynQ","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ephellon%2FSynQ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ephellon%2FSynQ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ephellon%2FSynQ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ephellon%2FSynQ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ephellon","download_url":"https://codeload.github.com/Ephellon/SynQ/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239680987,"owners_count":19679509,"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":[],"created_at":"2024-11-07T19:37:18.448Z","updated_at":"2025-12-14T05:30:12.343Z","avatar_url":"https://github.com/Ephellon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SynQ.js Help\nSynQ.js is a local storage caching/syncing system.\n\nHelp is also built into SynQ, just use `SynQ.help( string:item-name )` or `SynQ.help('*')`.\n\n# HTML\n## synq-data\nSynchronizes an element's value, or innerText (priority to value).\n- Usage: `\u003celement synq-data\u003e...\u003c/element\u003e`\n- Interpreted Type: Boolean\n\n## synq-host\nCreates a main object (for multiple frames), and is given the highest priority. Also sets the element's [NAME] to its [ID], or [SYNQ-UUID].\n- Usage: `\u003celement synq-host=host-name\u003e...\u003c/element\u003e`\n- Interpreted Type: String\n\n## synq-html\nSynchronizes an element's outerHTML.\n- Usage: `\u003celement synq-html\u003e...\u003c/element\u003e`\n- Interpreted Type: Boolean\n\n## synq-skip\nDelays synchronizing an element. Especially useful for multiple IFRAMEs with access to the parent document.\n- Usage: `\u003celement synq-skip=number-of-delays\u003e...\u003c/element\u003e`\n- Interpreted Type: Number\n\n_synq-skip: defaults to 0 if no value is given._\n\n## synq-text\nSynchronizes an element's innerHTML.\n- Usage: `\u003celement synq-text\u003e...\u003c/element\u003e`\n- Interpreted Type: Boolean\n\n## synq-uuid\nThe UUID that SynQ generates for each synchronized element.\n- Usage: `\u003celement synq-uuid=static-uuid\u003e...\u003c/element\u003e`\n- Interpreted Type: String\n\n_synq-uuid: if you set [synq-uuid], all copies of the element (including across frames) will need to have the same value. Otherwise, SynQ will handle this assignment automatically._\n\n# JavaScript\n## addEventListener\nAdds an event listener to SynQ's push, pull, pop, clear, broadcast, retrieve, or cage method.\n- Usage: `SynQ.addEventListener(event-name, callback)`\n- Arguments: String, Function\n- Returns: Number\n\n_event-name: push, pull, pop, clear, broadcast, retrieve, or cage._\n\n_return: the number of events attached._\n\n## append\nAdds data to a global array.\n- Usage: `SynQ.append(array-name, data[, key[, delimiter]])`\n- Arguments: String, String[, String[, String]]\n- Returns: \u003carray-name\u003e\n\n_key: the password to lock/unlock the data with._\n\n## clear\nRemoves all owned items from storage (related to SynQ).\n- Usage: `SynQ.clear([remove-all])`\n- Arguments: [Boolean]\n- Returns: Undefined\n\n_remove-all: if set to true, will remove all private items too._\n\n## decodeURL\nDecodes a URL string.\n- Usage: `SynQ.decodeURL(URL)`\n- Arguments: String\n- Returns: String\n\n## download\nRetruns data from the global storage item (see also, 'SynQ.push').\n- Usage: `SynQ.download(name[, key])`\n- Arguments: String[, String]\n- Returns: String\n\n_key: the password to lock/unlock the data with._\n\n## esc\nThe list delimeter for SynQ to use when storing element values.\n- Usage: `SynQ.esc = delimeter`\n- Types: String\n\n## eventlistener\nThe Event Listener for SynQ (fires automatically from SynQ).\n- Usage: `SynQ.eventlistener(event)`\n- Arguments: Object\n- Returns: Undefined\n\n## get\nReturns data from the local storage storage item.\n- Usage: `SynQ.get(name[, key])`\n- Arguments: String[, String]\n- Returns: String\n\n_key: the password to lock/unlock the data with._\n\n## help\nDisplays help messages.\n- Usage: `SynQ.help(item-name)`\n- Arguments: String\n- Returns: String\n\n## last\nAn array that's used to hold each item's name in the order they're created.\n- Usage: `SynQ.last = ['name-1', 'name-2'...]`\n- Types: Array\n\n## last_upload\nAn array that's used to hold each item's name in the order they're created.\n- Usage: `SynQ.lastupload = ['name-1', 'name-2'...]`\n- Types: Array\n\n## list\nReturns the currently owned storage items.\n- Usage: `SynQ.list([show-all])`\n- Arguments: Boolean\n- Returns: Object\n\n_show-all: when set to true, will return private items as well._\n\n## lock\nLocks and unlocks a string.\n- Usage: `SynQ.lock(data, key)`\n- Arguments: String, String\n- Returns: String\n\n## pack16\nPacks (encodes) a UTF-16 character, by using two UTF-8 characters.\n- Usage: `SynQ.pack16(character[, character])`\n- Arguments: Character[, Character]\n- Returns: String\n\n_return: if the second character is missing, then the first character will be returned._\n\n## parseFunction\nReturns an array of function data.\n- Usage: `SynQ.parseFunction(function-string)`\n- Arguments: String\n- Returns: Array =\u003e `{0: [function parameters], 1: [function statements], 2: [function name], length: 3}`\n\n## parseSize\nReturns a number from an SI formatted* string.\n- Usage: `SynQ.parseSize(number[, base[, symbol]])`\n- Arguments: String[, Number[, String]]\n- Returns: Number\n\n_* Does not recognize 'd' (deci), 'h' (hecto) or 'c' (centi)_\n\n## parseURL\nReturns a URL object.\n- Usage: `SynQ.parseURL(URL)`\n- Arguments: String\n- Returns: Object =\u003e `{href, origin, protocol, scheme, username, password, host, port, path, search, searchParameters, hash}`\n\n## pop\nRemoves, and returns the item from the local storage.\n- Usage: `SynQ.pop([name[, key]])`\n- Argumments: [String[, String]]\n- Returns: String\n\n_name: the name of the item to fetch. If left empty, will use the name of the last item created._\n_key: the password to lock/unlock the data with._\n\n## prevent\nUsed to prevent a value from being used.\n- Usage: `SynQ.prevent(variable, illegal-values, error-message[, helper-link])`\n- Arguments: (Array|String), (Array|RegExp), String[, String]\n- Returns: Undefined\n- Throws: Error(\u003cmessage[ + helper-link]\u003e)\n\n_helper-link: the word, or phrase used by SynQ.help to display the help message, e.g. `SynQ.prevent(null, [null], 'This is an example error', 'example')` =\u003e \"... see SynQ.help('example')\"._\n\n## pull\nReturns data from a local storage array.\n- Usage: `SynQ.pull(array-name[, key[, delimiter]])`\n- Arguments: String[, String[, String]]\n- Returns: Array\n\n_key: the password to lock/unlock the data with_\n\n## push\nAppends data to a local storage array (delimited by SynQ.esc).\n- Usage: `SynQ.push(array-name, data[, key])`\n- Arguments: String, String[, String]\n- Returns: String\u003carray-name\u003e\n\n_key: the password to lock/unlock the data with_\n\n## recall\nGets data from a global array.\n- Usage: `SynQ.recall(array-name[, key[, delimiter]])`\n- Arguments: String[, String[, String]]\n- Returns: Array\n\n_key: the password to lock/unlock the data with_\n\n## removeEventListener\nRemoves a(n) event listener(s).\n- Usage: `SynQ.removeEventListener(function-name[, event-name])`\n- Arguments: String[, String]\n- Returns: Array | String\n\n_event-name: push, pull, pop, clear, broadcast, retrieve, or cage. If left empty, will remove \u003cfunction-name\u003e from every event._\n\n## salt\nSalts (encrypts) a string, usually a password.\n- Usage: `SynQ.salt(string)`\n- Arguments: String\n- Returns: String\n\n## set\nAdds the item to the storage.\n- Usage: `SynQ.set(name, data[, key])`\n- Arguments: String, String[, String]\n- Returns: \u003cname\u003e\n\n_key: the password to lock/unlock the data with._\n\n## sign\nHashes a string (think of SHA, or MD5).\n- Usage: `SynQ.sign(string[, fidelity-level])`\n- Arguments: String[, Float]\n- Returns: String\n\n_fidelity-level: determines the size of the returned string. The closer to 1 the level is, the shorter the string._\n\n## signature\nThe UUID of the current page (if use_global_synq_token is undefined), or current domain.\n\nCurrent Signature: synq://njp494dk4/\n\n## size\n1. Returns the maximum amount of space for the storage (in bytes; 1B = 8b)\n  - Usage: `SynQ.size()`\n  - Arguments: NONE\n  - Returns: Integer\n\n2. Returns the SI formatted version of the given number.\n  - Usage: `SynQ.size(number[base, [symbol]])`\n  - Arguments: Number[, Number[, String]]\n  - Returns: String\n\n_base: the base to use, e.g. 1000; default is 1024._\n_symbol: the symbol to append to the returned string, default is 'iB'._\n\n## snip\nRemoves, and returns the item from the global storage (similar to 'SynQ.pop').\n- Usage: `SynQ.snip(name[, key])`\n- Arguments: String[, String]\n- Returns: String\n\n_key: the password to lock/unlock the data with._\n\n## syn\nThe attribute name(s) for elements to update.\n- Usage: `SynQ.syn = ['name-1', 'name-2'...]`\n- Types: Array | String\n- Default: [\"synq-data\",\"synq-text\",\"synq-html\",\"synq-host\"]\n\n## triggerEvent\nTriggers all event listeners for an event.\n- Usage: `SynQ.triggerEvent(event-name[, data])`\n- Arguments: String[, Array]\n- Returns: \u003cdata\u003e\n\n_data: the arguments to pass onto each listener._\n\n## unlock\nLocks and unlocks a string.\n- Usage: `SynQ.unlock(data, key)`\n- Arguments: String, String\n- Returns: String\n\n## unpack16\nUnpacks (decodes) a UTF-16 character into two UTF-8 characters.\n- Usage: `SynQ.unpack16(character)`\n- Arguments: Character\n- Returns: String\n\n_return: automatically handles UTF-8 characters, and returns the character iteslf._\n\n## upload\nAdds data to the global storage item (see also, 'SynQ.pull').\n- Usage: `SynQ.upload(name[, data[, key]])`\n- Arguments: String[, String[, String]]\n- Returns: String\n\n_return: a UUID for the data._\n_data: if no data is given, still returns the UUID._\n_key: the password to lock/unlock the data with._\n\n## used\nReturns the number of bytes (1B = 8b) in use.\n- Usage: `SynQ.used([synq-only])`\n- Arguments: [Boolean]\n- Returns: Integer\n\n_synq-only: when set to true, will ony return the amount of owned space SynQ is using._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fephellon%2Fsynq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fephellon%2Fsynq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fephellon%2Fsynq/lists"}