{"_id":"tiny-editorconfig","_rev":"3183688","name":"tiny-editorconfig","description":"A tiny isomorphic parser and resolver for EditorConfig.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"time":{"modified":"2023-12-06T08:48:14.000Z","created":"2023-11-15T01:13:27.449Z","1.0.0":"2023-11-15T01:13:27.449Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/tiny-editorconfig.git"},"versions":{"1.0.0":{"name":"tiny-editorconfig","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/tiny-editorconfig.git"},"description":"A tiny isomorphic parser and resolver for EditorConfig.","version":"1.0.0","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["editorconfig","parser","resolver"],"dependencies":{"ini-simple-parser":"^1.0.0","zeptomatch":"^1.1.3"},"devDependencies":{"benchloop":"^2.1.1","fava":"^0.3.1","tsex":"^3.0.1","typescript":"^5.2.2"},"gitHead":"9cda9b26d1ba28894bb823796f41f2ee71d309d1","bugs":{"url":"https://github.com/fabiospampinato/tiny-editorconfig/issues"},"homepage":"https://github.com/fabiospampinato/tiny-editorconfig#readme","_id":"tiny-editorconfig@1.0.0","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"shasum":"5a289d3bf1620fa8f600155492000d62c4651931","size":5248,"noattachment":false,"key":"/tiny-editorconfig/-/tiny-editorconfig-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/tiny-editorconfig/download/tiny-editorconfig-1.0.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tiny-editorconfig_1.0.0_1700010807213_0.37119492935111653"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-15T01:13:27.449Z","publish_time":1700010807449,"_source_registry_name":"default","_cnpm_publish_time":1700010807449}},"readme":"# Tiny EditorConfig\n\nA tiny isomorphic parser and resolver for [EditorConfig](https://editorconfig.org/).\n\n## Install\n\n```sh\nnpm install --save tiny-editorconfig\n```\n\n## Usage\n\n```ts\nimport * as EditorConfig from 'tiny-editorconfig';\n\n// It can parse an .editorconfig string\n\nconst INPUT1 = `\n  root=true\n\n  [*]\n  charset = UTF-8\n  end_of_line = lf\n  indent_size = 2\n  indent_style = \"space\"\n  insert_final_newline = true\n  trim_trailing_whitespace = true\n\n  [*.md]\n  trim_trailing_whitespace = false\n`;\n\nconst parsed1 = EditorConfig.parse ( INPUT );\n// {\n//   root: true,\n//   overrides: {\n//     '*': {\n//       charset: 'utf-8',\n//       endOfLine: 'lf',\n//       indentSize: 2,\n//       indentStyle: 'space',\n//       insertFinalNewline: true,\n//       trimTrailingWhitespace: true\n//     },\n//     '*.md': {\n//       trimTrailingWhitespace: false\n//     }\n//   }\n// }\n\nconst INPUT2 = `\n  [*]\n  end_of_line = crlf\n  indent_size = 4\n`;\n\nconst parsed2 = EditorConfig.parse ( INPUT );\n// {\n//   overrides: {\n//     '*': {\n//       endOfLine: 'crlf',\n//       indentSize: 4\n//     }\n//   }\n// }\n\n// It can resolve multiple configurations for a given path\n\nconst resolved = resolve ( [PARSED1, PARSED2], '/path/to/test.md' );\n// {\n//   root: true,\n//   charset: 'utf-8',\n//   endOfLine: 'crlf',\n//   indentSize: 4,\n//   indentStyle: 'space',\n//   insertFinalNewline: true,\n//   trimTrailingWhitespace: false\n// }\n```\n\n## License\n\nMIT © Fabio Spampinato\n","_attachments":{},"homepage":"https://github.com/fabiospampinato/tiny-editorconfig#readme","bugs":{"url":"https://github.com/fabiospampinato/tiny-editorconfig/issues"}}