{"id":22128886,"url":"https://github.com/shysolocup/nutfl","last_synced_at":"2025-10-09T23:10:49.515Z","repository":{"id":148838314,"uuid":"590148025","full_name":"shysolocup/nutfl","owner":"shysolocup","description":"Library of Python package ports and custom functions","archived":false,"fork":false,"pushed_at":"2023-03-23T14:22:24.000Z","size":57,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T08:49:10.563Z","etag":null,"topics":["javascript","js","py","python","python-3","python3"],"latest_commit_sha":null,"homepage":"","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/shysolocup.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}},"created_at":"2023-01-17T19:00:44.000Z","updated_at":"2023-03-23T13:29:29.000Z","dependencies_parsed_at":"2023-11-12T00:25:11.343Z","dependency_job_id":"382a6352-e206-4f8f-b5dd-757bf0f95f21","html_url":"https://github.com/shysolocup/nutfl","commit_stats":null,"previous_names":["paigeroid/nutfl","paishee/nutfl","shysolocup/nutfl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shysolocup/nutfl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shysolocup%2Fnutfl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shysolocup%2Fnutfl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shysolocup%2Fnutfl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shysolocup%2Fnutfl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shysolocup","download_url":"https://codeload.github.com/shysolocup/nutfl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shysolocup%2Fnutfl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002341,"owners_count":26083340,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","js","py","python","python-3","python3"],"created_at":"2024-12-01T17:48:34.200Z","updated_at":"2025-10-09T23:10:49.473Z","avatar_url":"https://github.com/shysolocup.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nutfl\nA package for JavaScript that is essentially just a library of functions I use while scripting. It includes recreations of some Python package functions as well as a few custom functions that might help with development. Most of the functions work for both Node JS and Web JS.\n\n\n**NOTE:** None of these ports are official I just ported them over because it made it easier for me. Also sorry if it's a bit messy and some things may be off.\n\n## Python Ports\n**Random:**\n```js\nvar {random} = require('./nutfl');\n```\n- random.randint(min, max);\n- random.choice(array);\n- random.randopp(chance, min, max);\n\n**Asyncio:**\n```js\nvar {asyncio} = require('./nutfl');\n```\n- asyncio.sleep(seconds);\n- asyncio.sleepMs(milliseconds);\n\n**Datetime:**\n```js\nvar {datetime} = require('./nutfl');\n```\n- datetime.datetime.now(datestring);\n\n**Json:**\n*(only works on Node JS)*\n```js\nvar {json} = require('./nutfl');\n```\n- json.load(data);\n- json.clear(file);\n- json.dump(data, file, args)\n#### *these kinda need examples so here:* \n```js\n// these should be separated by a sleep or else they'll break, use await asyncio.sleepMs(5); that should work\njson.dump({\"a\": \"b\"}, './file.json', {indent: 4});\n\njson.set(\".a\", \"b\", './file.json', {indent: 4});\njson.set('[\"a\"]', \"b\", './file.json');\n\njson.clear('./file.json');\n```\n\n## Custom\n**Html:**\n```js\nvar {html} = require('./nutfl');\n```\n- html.clear();\n- html.isFullscreen;\n\n**ExtMath:**\n```js\nvar {extMath} = require('./nutfl');\n```\n- extMath.divmod(x, y);\n- divmod(x, y);\n\n**File \u0026 Link:**\n```js\nvar {file} = require('./nutfl');\nvar {link} = require('./nutfl');\n```\n*main file*\n- file.isJS;\n- file.isHTML;\n```js\n/* index.js */\nvar {file} = require('./nutfl');\n\nconsole.log(file.isJS); // true\nconsole.log(file.isHTML); // false\n```\n*files and links*\n- file.isImage(file, includeGIFS`default false`);\n- file.isGIF(file);\n- file.isVideo(file);\n- file.isAudio(file);\n- file.isType(file, type);\n- string.isImage(includeGIFS`default false`);\n- string.isGIF();\n- string.isVideo();\n- string.isAudio();\n- string.isType(type);\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"text/javascript\" src=\"./nutfl/index.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cscript\u003e\n      document.write(file.isJS); // false\n      document.write(file.isHTML); // true\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Miscellaneous\n**Objects:**\n- object.keys;\n- object.values;\n- object.length;\n- object.stringify(replacer, indent`(optional)`);\n- object.parse(reviver`(optional)`);\n- object.indexOf(name);\n- object.fetchKey(index);\n- object.fetchValues(index);\n```js\nlet data = {\n  \"a\": \"b\",\n  \"c\": [\"d\", \"e\"]\n};\n\nconsole.log(data.length); // 2\nconsole.log(data.keys); // [\"a\", \"c\"]\nconsole.log(data.values); // [\"b\",  [\"d\", \"e\"]]\nconsole.log(data.indexOf(\"c\")); // 1\nconsole.log(data.fetchKey(1)); // \"c\"\nconsole.log(data.fetchValues(1)); // [\"d\", \"e\"]\n```\n\n**Array:**\n- array.randomChoice();\n- array.endsWithC(char);\n- array.startsWithC(char);\n- array.equalFor(array);\n- array.prune(amount, direction);\n- array.remove(index);\n- array.flip(index1, index2);\n- array.includesFor(array);\n\n**Strings:**\n- string.replaceFor(array, replaceWith);\n- string.endsWithC(char);\n- string.startsWithC(char);\n- string.get(index, type`word or letter`);\n- string.includesFor(array);\n- string.startsWithFor(array);\n- string.endsWithFor(array);\n- string.isImage(includeGIFS`default false`);\n- string.isGIF();\n- string.isVideo();\n- string.isAudio();\n- string.isType(type);\n\n# Usage\n**Node JS:**\n```js\nvar {random, asyncio} = require(\"./nutfl\");\n```\n\n**Web JS / HTML:**\n```html\n\u003chead\u003e\n  \u003cscript type=\"text/javascript\" src=\"./nutfl/index.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshysolocup%2Fnutfl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshysolocup%2Fnutfl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshysolocup%2Fnutfl/lists"}