{"name":"@dprint/formatter","version":"0.1.5","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","module":"./esm/mod.js","main":"./cjs/mod.js","types":"./types/mod.d.ts","exports":{".":{"import":"./esm/mod.js","require":"./cjs/mod.js","types":"./types/mod.d.ts"}},"dependencies":{},"_id":"@dprint/formatter@0.1.5","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-o0Y3gzAPb4/CWaEaKmqIXHlZQQdtxDEDd+DP+RqGOqkJ5OJ2Nw8p6r0DjJqzy0wN87in7h/9ulE29hIh+5fALw==","shasum":"ea2119f4dd231b5ffe96636df3eb9b993cc6586b","tarball":"http://registry-npm.ywwl.com/@dprint/formatter/download/@dprint/formatter-0.1.5.tgz","fileCount":8,"unpackedSize":20512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzzgRCRA9TVsSAnZWagAAkA0P/3I++9wCG75T9NFQ4vi9\nNprUTpy6BQlDdyVJr6qeSnrRv44Ng/Ccr6qvVAqC5QxSqk6VyCKk8ITjuhKo\nWM6rWY0SyptnvPdBqNBh8dP7MEiEqjY2Fi6QwGRzqkmjZo+AFnOJKOQhLIRH\nww+XX5JMRkrzrbrfkvYcV07OIO70sejwmM2WluQDfkQi3O3oS1X2b66/lVy9\nzs1MdSnbi4/y8wbMgWwdZGo38vSf0mvMQVy4fqxBWFEXi2RgKy9GfnXvZIkg\nreXw4hRum7YXoJa1QXZ+oukvr4Ix5n7wYYyPXxsl99034zZic79GDv6oG80v\n7tII7/h1mCt6izu89MqurLMCkfJFHdZXITJ7fL2abPvrsVOHRWfWmV/arwcu\nxloomR0QrUrtXp9kd29566LiSHZ20QFeuBl/AY76pcP/dIQpq+qSjkL9pyg9\naFXVhZaE/vwirf6YwtrEkTWCJj0zLNsH52mMsIKirIMxmrX8QQXxjyp/7aOc\nYm96MTQNe45/inDqDMCywOeKU3GrDxE6tTjlx75ZzafnifpXPGfxCGzslLN8\nF8TDIBFHY0d2x62TbE/8qj0amk607DPJ4lsVemyrRhlWUQQdFi9Kv2rjGzBF\nbmLrLrzKa8CmAaMqY+vsTPrmeuv28Ya2DSWf4eT/yvMVVUFgeGv8l/R9aSb2\nqmaG\r\n=U9Je\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIExdHBiK7cv9iWkv4Qvrpvl1JTmzJUZ5SIK2k9zGGvQ5AiAJe/IAaZoT7dt5ArvUD9n9uNxJJubCvj2vLfzEGS7fjg=="}],"size":4307,"noattachment":false,"key":"/@dprint/formatter/-/@dprint/formatter-0.1.5.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.1.5_1634653213492_0.2775745331543358"},"_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":1634653213706,"_cnpm_publish_time":1634653213706,"dist-tags":{"latest":"0.6.0"}}