{"id":18653365,"url":"https://github.com/fullstackacademy/fs-misc","last_synced_at":"2025-04-11T16:32:26.179Z","repository":{"id":57242302,"uuid":"74324048","full_name":"FullstackAcademy/fs-misc","owner":"FullstackAcademy","description":"Miscellaneous utilities for Fullstack Academy projects","archived":false,"fork":false,"pushed_at":"2017-03-29T20:40:58.000Z","size":3,"stargazers_count":2,"open_issues_count":2,"forks_count":3,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-09T02:37:47.102Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FullstackAcademy.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}},"created_at":"2016-11-21T03:49:09.000Z","updated_at":"2017-08-14T00:05:11.000Z","dependencies_parsed_at":"2022-09-15T00:51:25.897Z","dependency_job_id":null,"html_url":"https://github.com/FullstackAcademy/fs-misc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FullstackAcademy%2Ffs-misc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FullstackAcademy%2Ffs-misc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FullstackAcademy%2Ffs-misc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FullstackAcademy%2Ffs-misc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FullstackAcademy","download_url":"https://codeload.github.com/FullstackAcademy/fs-misc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248441295,"owners_count":21103960,"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-07T07:11:20.531Z","updated_at":"2025-04-11T16:32:25.918Z","avatar_url":"https://github.com/FullstackAcademy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fs-misc\n\nSmall utility functions, binaries, and snippets which tend to be reused across multiple Fullstack Academy projects but don't quite merit their own repository.\n\n## `pg-init`\n\nCreate a Postgres database if it does not exist. Exits with 0 status regardless of whether the db existed already or not.\n\n### As binary usable in npm scripts:\n\n```sh\nyarn add fs-misc\n```\n\n```json\n\"scripts\": {\n    \"db-init\": \"pg-init name_of_db\"\n}\n```\n\n```sh\nyarn run db-init\n```\n\n### As a programmatic tool in modules:\n\n```js\nconst fsMisc = require('fs-misc')\n\nfsMisc.pgInit('name_of_db')\n.then(result =\u003e {\n    console.log(result.raw) // raw stdout\n    console.log(result.pretty) // prettified / formatted stdout\n})\n.catch(console.error.bind(console))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullstackacademy%2Ffs-misc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffullstackacademy%2Ffs-misc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullstackacademy%2Ffs-misc/lists"}