{"id":13659523,"url":"https://github.com/serkanyersen/pjson","last_synced_at":"2025-07-02T15:32:36.838Z","repository":{"id":34637606,"uuid":"38591744","full_name":"serkanyersen/pjson","owner":"serkanyersen","description":"Let's you read package.json from any directory","archived":false,"fork":false,"pushed_at":"2018-06-29T20:25:35.000Z","size":12,"stargazers_count":25,"open_issues_count":2,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-16T19:08:26.685Z","etag":null,"topics":["helpers","json-files","nodejs","npm","package-json","typescript","utilities"],"latest_commit_sha":null,"homepage":"","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/serkanyersen.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}},"created_at":"2015-07-06T01:48:42.000Z","updated_at":"2021-09-30T17:28:27.000Z","dependencies_parsed_at":"2022-09-01T23:51:04.260Z","dependency_job_id":null,"html_url":"https://github.com/serkanyersen/pjson","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/serkanyersen/pjson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkanyersen%2Fpjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkanyersen%2Fpjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkanyersen%2Fpjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkanyersen%2Fpjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serkanyersen","download_url":"https://codeload.github.com/serkanyersen/pjson/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkanyersen%2Fpjson/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263166067,"owners_count":23424084,"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":["helpers","json-files","nodejs","npm","package-json","typescript","utilities"],"created_at":"2024-08-02T05:01:09.691Z","updated_at":"2025-07-02T15:32:36.807Z","avatar_url":"https://github.com/serkanyersen.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# PJSON\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fserkanyersen%2Fpjson.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fserkanyersen%2Fpjson?ref=badge_shield)\n\n\nPJSON is a simple npm package that lets you read the package.json file.\n\n## Usage\n\nInstall it\n```\nnpm install pjson --save\n```\n\nand use it in your code like this\n\n```javascript\nvar pjson = require('pjson');\n\n// simply access values package.json\nconsole.log(pjson.version);\n```\n\n## Why?\n\nIn Node.js you can already import json files by simple giving their names in the `require` statements but this approach doesn't always work well.  \n\nFirst of all it's path dependent. So if your project has a nested structure you might end up with code that looks like this\n\n```javascript\nvar pjson = require('../../../package.json');\n```\n\n#### TypeScript\n\nIn typescript you cannot create module definitions for relatively imported things. PJSON resolves this issue for you because you can import it just by name\n\n#### Old versions of Node\n\nImporting JSON files using require is only enabled in later versions of node. For old versions, PJSON might be useful\n\n#### Because I need it\n\nIt's simple, I needed it for my own project and I though it might be useful for others as well :)\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fserkanyersen%2Fpjson.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fserkanyersen%2Fpjson?ref=badge_large)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkanyersen%2Fpjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserkanyersen%2Fpjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkanyersen%2Fpjson/lists"}