{"id":15290284,"url":"https://github.com/npm/stringify-package","last_synced_at":"2025-10-07T03:32:34.435Z","repository":{"id":32742840,"uuid":"141324283","full_name":"npm/stringify-package","owner":"npm","description":"stringifies npm-written json files","archived":true,"fork":false,"pushed_at":"2022-08-22T19:50:15.000Z","size":107,"stargazers_count":10,"open_issues_count":0,"forks_count":8,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-10-01T16:06:49.013Z","etag":null,"topics":["npm-cli"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-07-17T17:49:31.000Z","updated_at":"2023-08-25T22:38:50.000Z","dependencies_parsed_at":"2022-07-27T22:48:11.552Z","dependency_job_id":null,"html_url":"https://github.com/npm/stringify-package","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fstringify-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fstringify-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fstringify-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fstringify-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npm","download_url":"https://codeload.github.com/npm/stringify-package/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235586082,"owners_count":19014028,"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":["npm-cli"],"created_at":"2024-09-30T16:06:46.027Z","updated_at":"2025-10-07T03:32:29.395Z","avatar_url":"https://github.com/npm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stringify-package [![npm version](https://img.shields.io/npm/v/stringify-package.svg)](https://npm.im/stringify-package) [![license](https://img.shields.io/npm/l/stringify-package.svg)](https://npm.im/stringify-package) [![Travis](https://img.shields.io/travis/npm/stringify-package/latest.svg)](https://travis-ci.org/npm/stringify-package) [![AppVeyor](https://img.shields.io/appveyor/ci/npm/stringify-package/latest.svg)](https://ci.appveyor.com/project/npm/stringify-package) [![Coverage Status](https://coveralls.io/repos/github/npm/stringify-package/badge.svg?branch=latest)](https://coveralls.io/github/npm/stringify-package?branch=latest)\n\n[`stringify-package`](https://github.com/npm/stringify-package) is a standalone\nlibrary for writing out package data as a JSON file. It is extracted from npm.\n\n## Install\n\n`$ npm install stringify-package`\n\n## Table of Contents\n\n* [Example](#example)\n* [Features](#features)\n* [Contributing](#contributing)\n* [API](#api)\n  * [`stringifyPackage`](#stringifypackage)\n\n### Example\n\n```javascript\nconst fs = require('fs')\nconst pkg = { /* ... */ }\n\nfs.writeFile('package.json', stringifyPackage(pkg), 'utf8', cb(err) =\u003e {\n    // ...\n})\n```\n\n### Features\n\n* Ensures consistent file indentation  \n  To match existing file indentation,\n  [`detect-indent`](https://npm.im/detect-indent) is recommended.\n\n* Ensures consistent newlines  \n  To match existing newline characters,\n  [`detect-newline`](https://npm.im/detect-newline) is recommended.\n\n### Contributing\n\nThe npm team enthusiastically welcomes contributions and project participation!\nThere's a bunch of things you can do if you want to contribute! The [Contributor\nGuide](CONTRIBUTING.md) has all the information you need for everything from\nreporting bugs to contributing entire new features. Please don't hesitate to\njump in if you'd like to, or even ask us questions if something isn't clear.\n\n### API\n\n### \u003ca name=\"stringifypackage\"\u003e\u003c/a\u003e `\u003e stringifyPackage(data, indent, newline) -\u003e String`\n\n#### Arguments\n\n* `data` - the package data as an object to be stringified\n* `indent` - the number of spaces to use for each level of indentation (defaults to 2)\n* `newline` - the character(s) to be used as a line terminator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm%2Fstringify-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpm%2Fstringify-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm%2Fstringify-package/lists"}