{"module":"./esm/mod.js","main":"./umd/mod.js","types":"./types/mod.d.ts","name":"@dprint/formatter","version":"0.2.0","description":"Wasm formatter for dprint plugins.","repository":{"type":"git","url":"git+https://github.com/dprint/js-formatter.git"},"keywords":["dprint","formatter","wasm"],"author":{"name":"David Sherret"},"license":"MIT","bugs":{"url":"https://github.com/dprint/js-formatter/issues"},"homepage":"https://github.com/dprint/js-formatter#readme","exports":{".":{"import":"./esm/mod.js","require":"./umd/mod.js","types":"./types/mod.d.ts"}},"scripts":{"test":"node test_runner.js"},"dependencies":{},"devDependencies":{"@types/node":"16.11.1","chalk":"4.1.2","@deno/shim-deno-test":"~0.2.0","undici":"^4.12.1"},"gitHead":"29ad3fe918d72a84bebd4a8c8c393d2b292792de","_id":"@dprint/formatter@0.2.0","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-E1q1JaOPeEUBhG//IUayqJQvNpqprZ0OCF8B/bIhUqSsMIp0Y74PgF8JPvDCrOdq43qiGUYAavVO8iCBHOoU/A==","shasum":"5eb044e0969ef5b918b26db42eb9d75e7c6661ee","tarball":"http://registry-npm.ywwl.com/@dprint/formatter/download/@dprint/formatter-0.2.0.tgz","fileCount":8,"unpackedSize":22800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2djnCRA9TVsSAnZWagAAyXgQAJ7tgm38lTnfn6dJDJso\nZN/l8h5iFnpziGBUUhN4mJA2giG2ae+mECu6Ka0OvVBYRidTP9OEvZgu7T52\nmNi0/Dxm2LB5r4p8iTEQXCIwgHW2S5yyqndjSHU6xYF1y8E+W8gKq+sFb1JK\n3g8J79L2j+lX2S2lCC9e+A+cVmIx6iYwT398xZBLK77B16xLRRD6OAb9GIiC\n/63QS8/w0fOHk/JvD5yDYDVnho4OWpjSUFxdf6RWBMVvX91akeoypbMAl/rW\nkBms+GuLmbyGgLEMViB4WVcfa2vv+R2fQggkSsAFip85crT/SQu12Kv6Yt/b\naPbhn5TfsB9LlVMUUYXXOjyIg9avpVlAzR0mJ1CvIRMfY9CPc4GS7sjLpSi9\noGfNddpRZ+Ymt+l9OAT5vHqXJL6DGyhHVLCnTSUwrnZeFyR6ZpLR5MgdO002\nK+H9j/giYTMeQ6b/lbJK/4aoVWiC8NkhfP+Pggks8mzqQ4Ycjhu5m18mfiDp\nJYWHFr7BkpYs6i9osKXirfXW7whCmCzwFZzow16W/arSThYS6xPdNIcewip2\n+tM/NWLDhSjGZq1qM1EKIzZUkTHR8BaSEZwvjPKGSwAEO45H2yTzHGwzekc1\nA+BfDfDEdSAlcnbUqFHRsYoIKW/J/glGD3ika5UTSlRbtpQN3jCyf0Zd9Np9\nq4dT\r\n=T5a/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG13ZPuqsj6SdSiNJGZnUEpUilxAg4qIpRhnGKitGtUZAiBUAa+V6GNlYFJ55o00d3LkJtLj/Ro/PFgLxNy+z8n0xA=="}],"size":5053,"noattachment":false,"key":"/@dprint/formatter/-/@dprint/formatter-0.2.0.tgz"},"_npmUser":{"name":"dsherret","email":"dsherret@gmail.com"},"directories":{},"maintainers":[{"name":"dsherret","email":"dsherret@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/formatter_0.2.0_1641666791083_0.4448332828607642"},"_hasShrinkwrap":false,"readme":"# dprint - JS Formatter\n\n[![CI](https://github.com/dprint/js-formatter/workflows/CI/badge.svg)](https://github.com/dprint/js-formatter/actions?query=workflow%3ACI)\n[![npm version](https://badge.fury.io/js/%40dprint%2Fformatter.svg)](https://badge.fury.io/js/%40dprint%2Fformatter)\n[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/dprint/mod.ts)\n\nJS formatter for dprint Wasm plugins.\n\n## Deno\n\n```ts\nimport {\n  createStreaming,\n  GlobalConfiguration,\n} from \"https://deno.land/x/dprint/mod.ts\";\n\nconst globalConfig: GlobalConfiguration = {\n  indentWidth: 2,\n  lineWidth: 80,\n};\nconst tsFormatter = await createStreaming(\n  // check https://plugins.dprint.dev/ for latest plugin versions\n  fetch(\"https://plugins.dprint.dev/typescript-0.57.0.wasm\"),\n);\n\ntsFormatter.setConfig(globalConfig, {\n  semiColons: \"asi\",\n});\n\n// outputs: \"const t = 5\\n\"\nconsole.log(tsFormatter.formatText(\"file.ts\", \"const   t    = 5;\"));\n```\n\n## Node.js\n\nUse the following:\n\n```ts\nimport { createFromBuffer } from \"@dprint/formatter\";\n// You may have to use `getBuffer` on plugins that haven't updated yet.\n// See the plugins README.md for details.\nimport { getPath } from \"@dprint/json\";\nimport * as fs from \"fs\";\n\nconst buffer = fs.readFileSync(getPath());\nconst formatter = createFromBuffer(buffer);\n\nconsole.log(formatter.formatText(\"test.json\", \"{test: 5}\"));\n```\n\nUnfortunately Node.js doesn't have any way to cache compiles at the moment and so it will have a slower than ideal startup time.\n\n### Plugin NPM Packages\n\n- [@dprint/json](https://www.npmjs.com/package/@dprint/json)\n- [@dprint/typescript](https://www.npmjs.com/package/@dprint/typescript)\n- [@dprint/markdown](https://www.npmjs.com/package/@dprint/markdown)\n- [@dprint/toml](https://www.npmjs.com/package/@dprint/toml)\n- [@dprint/dockerfile](https://www.npmjs.com/package/@dprint/dockerfile)\n","publish_time":1641666791226,"_cnpm_publish_time":1641666791226,"dist-tags":{"latest":"0.6.0"}}