{"id":25854058,"url":"https://github.com/jeffy-g/rm-cstyle-cmts","last_synced_at":"2025-03-01T15:28:57.201Z","repository":{"id":24503227,"uuid":"101774489","full_name":"jeffy-g/rm-cstyle-cmts","owner":"jeffy-g","description":"remove c style comments from text file(javascript source, json file etc...","archived":false,"fork":false,"pushed_at":"2025-02-28T05:49:46.000Z","size":3065,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T13:02:57.436Z","etag":null,"topics":["c-style","delete","javascript","js","json","regex","regexp","regular-expression-literals","strip-comment"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/jeffy-g.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-29T15:05:38.000Z","updated_at":"2025-02-28T05:49:49.000Z","dependencies_parsed_at":"2023-09-28T10:01:07.043Z","dependency_job_id":"d4faf472-7a05-4b8d-9aa9-d5c6b19ea7a2","html_url":"https://github.com/jeffy-g/rm-cstyle-cmts","commit_stats":{"total_commits":636,"total_committers":5,"mean_commits":127.2,"dds":"0.44025157232704404","last_synced_commit":"d72ca38bb94509e7b9801e8be11dacce8e7aa12f"},"previous_names":[],"tags_count":110,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffy-g%2Frm-cstyle-cmts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffy-g%2Frm-cstyle-cmts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffy-g%2Frm-cstyle-cmts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffy-g%2Frm-cstyle-cmts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeffy-g","download_url":"https://codeload.github.com/jeffy-g/rm-cstyle-cmts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241384874,"owners_count":19954431,"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":["c-style","delete","javascript","js","json","regex","regexp","regular-expression-literals","strip-comment"],"created_at":"2025-03-01T15:28:56.612Z","updated_at":"2025-03-01T15:28:57.190Z","avatar_url":"https://github.com/jeffy-g.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Node.js CI](https://github.com/jeffy-g/rm-cstyle-cmts/actions/workflows/nodejs.yml/badge.svg)](https://github.com/jeffy-g/rm-cstyle-cmts/actions/workflows/nodejs.yml)\n[![CircleCI](https://circleci.com/gh/jeffy-g/rm-cstyle-cmts/tree/master.svg?style=svg)](https://circleci.com/gh/jeffy-g/rm-cstyle-cmts/tree/master)\n[![codecov](https://codecov.io/gh/jeffy-g/rm-cstyle-cmts/graph/badge.svg?token=pqMULIrDTY)](https://codecov.io/gh/jeffy-g/rm-cstyle-cmts)\n![NPM Version](https://img.shields.io/npm/v/rm-cstyle-cmts?style=plastic\u0026color=green)\n![node-current](https://img.shields.io/node/v/rm-cstyle-cmts?style=plastic)\n![LICENSE](https://img.shields.io/badge/License-MIT-blue.svg)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fjeffy-g%2Frm-cstyle-cmts.svg?type=shield\u0026issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2Fjeffy-g%2Frm-cstyle-cmts?ref=badge_shield\u0026issueType=license)\n[![DeepScan grade](https://deepscan.io/api/teams/3135/projects/4618/branches/37135/badge/grade.svg)](https://deepscan.io/dashboard#view=project\u0026tid=3135\u0026pid=4618\u0026bid=37135)\n[![Maintainability](https://api.codeclimate.com/v1/badges/6fb687e6fd2c33a0a328/maintainability)](https://codeclimate.com/github/jeffy-g/rm-cstyle-cmts/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/6fb687e6fd2c33a0a328/test_coverage)](https://codeclimate.com/github/jeffy-g/rm-cstyle-cmts/test_coverage)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/jeffy-g/rm-cstyle-cmts?style=plastic)\n![npm bundle size](https://img.shields.io/bundlephobia/min/rm-cstyle-cmts?style=plastic)\n![NPM Downloads](https://img.shields.io/npm/dm/rm-cstyle-cmts?style=plastic)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/jeffy-g/rm-cstyle-cmts?style=plastic)\n\n# remove cstyle comments (rm-cstyle-cmts)\n\nremove c style comments from text file. (javascript source, json file etc)\n\n* This module removes comments from source files such as `typescript` and `javascript`.  \n  It does not remove lines that are meaningful to `typescript`, such as `@ts-ignore` and `\u003creference types=\"node\"/\u003e`,  \n  but removes other **single line comments** and **multi line comments**.\n\n* For other **single line comment** and **multi line comment**, it is possible to control which comment is removed by setting [**scan listener**](#the-walkthrough-mode).\n\n* This module is [much faster than the popular comment removal module](#performance-measurement-with-benchmarkjs).\n\n* [**gulp plugin**](#rm-cstyle-cmts-gulp-plugin) is available.\n\n* [**web version**](#rm-cstyle-cmts-web-version) is available.\n\n* new property `keepJsDoc` (v3.3.11)\n\n* regex flags strict check (v3.3.15)\n  + Even if it is not written as a regular expression in the text,  \n    it will be detected if it is valid as a regex (this is by design).\n\n## install\n\n* npm\n\n  ```shell\n  $ npm install rm-cstyle-cmts --save-dev  \n  # shorthand  \n  $ npm i rm-cstyle-cmts -D\n  ```\n\n* yarn\n\n  ```shell\n  $ yarn add rm-cstyle-cmts -D\n  ```\n\n## Features\n\n+ remove mode\n\n  ```js\n  const rmc = require(\"rm-cstyle-cmts\");\n  const removed = rmc(\"\u003csource file content\u003e\");\n  ```\n\n+ walkthrough mode (walkthrough mode does things like statistics for source code comments by setting a scan listener.)\n\n  ```js\n  const rmc = require(\"rm-cstyle-cmts\");\n\n  /** @type {Map\u003cstring, number\u003e} */\n  const tagStatistics = new Map();\n  /**\n   * Take statistics for jsDoc tag\n   *\n   * @param {object} context\n   * @param {TScannerEventContext[\"event\"]} context.event - currently EScannerEvent.(SingleLineComment | MultiLineComment) only\n   * @param {TScannerEventContext[\"fragment\"]} context.fragment comment body\n   * @param {TScannerEventContext[\"offset\"]} context.offset - fragment start offset from original source\n   */\n  function handleScanEvent({ event, fragment, offset }) =\u003e {\n    if (event === /*EScannerEvent.MultiLineComment*/1) {\n        if (/^\\/\\*\\*[^*]/.test(fragment)) {\n            const re = /(?\u003c=[\\s\\*{])@\\w+(?=\\s)/g;\n            /** @type {RegExpExecArray} */\n            let m;\n            while (m = re.exec(fragment)) {\n                const tag = m[0];\n                let count = tagStatistics.get(tag) || 0;\n                tagStatistics.set(tag, count + 1);\n            }\n        }\n    }\n    return true;\n  }\n\n  // At current implementation, accept one listener only\n  rmc.setListener(handleScanEvent);\n  rmc.walk(\"\u003csource file content\u003e\");\n  ```\n\n## API\n\nnode module.\n\n```js\nconst rmc = require(\"rm-cstyle-cmts\");\n```\n\n### run as remove mode\n\n```js\nconst opt = { collectRegex: true, showErrorMessage: true, preserveBlanks: true };\nconst removed = rmc(\"\u003csource file content\u003e\", opt);\n```\n\n- **source** `{string}` -- The target source content.\n- **opt** `{object}`\n  - [**opt.collectRegex**](https://github.com/jeffy-g/rm-cstyle-cmts/blob/master/src/index.d.ts#L19) `{true | undefined}` -- Whether collect detected regex. Default: `undefined`.\n  - [**opt.showErrorMessage**](https://github.com/jeffy-g/rm-cstyle-cmts/blob/master/src/index.d.ts#L27) `{true | undefined}` -- Whether to display an error message. Default: `undefined`.\n  - [**opt.preserveBlanks**](https://github.com/jeffy-g/rm-cstyle-cmts/blob/master/src/index.d.ts#L37) `{true | undefined}` -- Whether preserve whitespace and blank lines. Default: `undefined`.\n\n### run as walkthrough mode\n\n```js\nconst opt = { collectRegex: true, showErrorMessage: true };\nrmc.walk(\"\u003csource file content\u003e\", opt);\n```\n\n- **source** `{string}` -- The target source content.\n- **opt** `{object}`\n  - [**opt.collectRegex**](https://github.com/jeffy-g/rm-cstyle-cmts/blob/master/src/index.d.ts#L19) `{true | undefined}` -- Whether collect detected regex. Default: `undefined`.\n  - [**opt.showErrorMessage**](https://github.com/jeffy-g/rm-cstyle-cmts/blob/master/src/index.d.ts#L27) `{true | undefined}` -- Whether to display an error message. Default: `undefined`.\n\n## Playground\n\n+ [rm-cstyle-cmts Playground (powered by monaco-editor)](https://rm-cstyle-cmts-playground.netlify.com/)\n\n## Performance measurement with `Benchmark.js`\n\n```shell\n$ npm run benchmark\n```\n\n+ We are comparing the process of deleting only `comment` from the following sample\n\n  \u003cdetails\u003e\n\n  ```js\n  const json = `// see: http://json.schemastore.org/tsconfig\n  {\n    \"compilerOptions\": {\n      /* Basic Options */\n      \"target\": \"es5\",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */\n      \"module\": \"commonjs\",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */\n      // \"allowJs\": true,                       /* Allow javascript files to be compiled. */\n      // \"checkJs\": true,                       /* Report errors in .js files. */\n      // \"declaration\": true,                   /* Generates corresponding '.d.ts' file. */\n      // \"sourceMap\": true,                     /* Generates corresponding '.map' file. */\n      // \"outFile\": \"./\",                       /* Concatenate and emit output to single file. */\n      // \"outDir\": \"./\",                        /* Redirect output structure to the directory. */\n  \n      /* Strict Type-Checking Options */\n      \"strict\": true,                           /* Enable all strict type-checking options. */\n      // \"strictNullChecks\": true,              /* Enable strict null checks. */\n      // \"strictFunctionTypes\": true,           /* Enable strict checking of function types. */\n  \n      /* Additional Checks */\n      // \"noUnusedLocals\": true,                /* Report errors on unused locals. */\n      // \"noUnusedParameters\": true,            /* Report errors on unused parameters. */\n  \n      /* Module Resolution Options */\n      // \"baseUrl\": \"./\",                       /* Base directory to resolve non-absolute module names. */\n      // \"typeRoots\": [],                       /* List of folders to include type definitions from. */\n      \"esModuleInterop\": true                   /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */\n  \n      /* Experimental Options */\n      // \"experimentalDecorators\": true,        /* Enables experimental support for ES7 decorators. */\n      // \"emitDecoratorMetadata\": true,         /* Enables experimental support for emitting type metadata for decorators. */\n    },\n    \"files\": [\n      \"y\"\n    ]\n  }`;\n  ```\n\n  \u003c/details\u003e\n\n\u003e ### node v15.8.0\n\n```shell\n$ yarn benchmark\nyarn run v1.22.18\n$ cd etc/bench \u0026\u0026 yarn install \u0026\u0026 yarn start\n[1/4] Resolving packages...\nsuccess Already up-to-date.\n$ node bench.mjs\n\n- - - - - - - bench mark test - - - - - - - - -\nPlatform info:\nWindows_NT 10.0.19045 x64\nNode.JS: 15.8.0\nV8     : 8.6.395.17-node.23\nIntel(R) Core(TM) i7-3770 CPU @ 3.40GHz x 8\n\nstrip-comments x 11,184 ops/sec ±0.69% (84 runs sampled)\nstrip-json-comments x 17,525 ops/sec ±0.86% (94 runs sampled)\nrm-cstyle-cmts x 168,734 ops/sec ±0.84% (92 runs sampled)\nrm-cstyle-cmts (webpack) x 165,568 ops/sec ±1.22% (94 runs sampled)\nrm-cstyle-cmts (umd) x 164,756 ops/sec ±0.74% (94 runs sampled)\n- - done - -\nall results are equals? true # see NOTE:\nDone in 28.22s.\n```\n\n\u003e ### node 22.12.0\n\n```shell\nyarn run v1.22.18\n$ cd etc/bench \u0026\u0026 yarn install \u0026\u0026 yarn start\n[1/4] Resolving packages...\n[2/4] Fetching packages...\n[3/4] Linking dependencies...\n[4/4] Building fresh packages...\n\n$ node bench.mjs\n\n- - - - - - - bench mark test - - - - - - - - - \nPlatform info:\nWindows_NT 10.0.19045 x64\nNode.JS: 22.12.0\nV8     : 12.4.254.21-node.21\nIntel(R) Core(TM) i7-3770 CPU @ 3.40GHz x 8\n\nstrip-comments x 12,301 ops/sec ±0.43% (94 runs sampled)\nstrip-json-comments x 17,116 ops/sec ±0.16% (95 runs sampled)\nrm-cstyle-cmts x 218,466 ops/sec ±0.31% (96 runs sampled)\nrm-cstyle-cmts (webpack) x 216,343 ops/sec ±0.74% (95 runs sampled)\nrm-cstyle-cmts (umd) x 216,291 ops/sec ±0.28% (96 runs sampled)\n- - done - -\nall results are equals? true # see NOTE:\nDone in 28.56s.\n```\n\n+ NOTE: `strip-comments` may be buggy and is excluded from comparison\n\n## The `Walkthrough mode`\n\n`Walkthrough mode` does not modify original source.\n\nThe current implementation calls the `listener` on __line comment__ and __multi-line comment__ scan events.\n\n```ts\nimport * as rmc from \"rm-cstyle-cmts\";\n\n/**\n * @param {object} context\n * @param {TScannerEventContext[\"event\"]} context.event - currently EScannerEvent.(SingleLineComment | MultiLineComment) only\n * @param {TScannerEventContext[\"fragment\"]} context.fragment comment body\n * @param {TScannerEventContext[\"offset\"]} context.offset - fragment start offset from original source\n */\nfunction handleScanEvent({ event, fragment, offset }) =\u003e {\n  if (event === /*EScannerEvent.MultiLineComment*/1) {\n    // remove mode: preserve JSDoc comment\n    // walkthrough mode: whether proceed walkthrough\n    return /^\\/\\*\\*[^*]/.test(fragment);\n  }\n  return false;\n}\n// At current implementation, accept one listener only\nrmc.setListener(handleScanEvent);\n\nconst opt = { collectRegex: true, showErrorMessage: true };\nrmc(\"\u003ccommented source\u003e\", opt);\nrmc.walk(\"\u003ccommented source\u003e\", opt);\n```\n\n\u003e __NOTE__: Handling of listener in `remove mode` and `walkthrough mode`\n\n+ In `walkthrough mode`: Returns `true` to continue processing. otherwise stop processing.\n\n+ In `remove mode`: it returns `true` to preserve in the **line comment** and **multi line comment** deletion process.\n\n## `rm-cstyle-cmts` gulp plugin\n\n### gulp plugin sample task\n+ sample task to scan javascript related files directly under `node_modules`\n\n```shell\n$ npm run grmc-test:cjs\n```\n\n### API of gulp plugin\n\n```js\nconst gulp = require(\"gulp\"); \nconst grmc = require(\"rm-cstyle-cmts/cjs/gulp/\");\nconst grmcOpt = {\n    preserveBlanks: undefined, // remove blank lines and trailing whitespace\n    renderProgress: true,      // show progress\n    // isWalk: true // want walk through?\n};\ngulp.src([\"./src/**/*.{js,jsx,ts,tsx}\"]).pipe(\n    grmc.getTransformer(grmcOpt)\n).pipe(gulp.dest(\"./tmp\"));\n```\n\n#### gulp plugin options\n\n- [**preserveBlanks**](https://github.com/jeffy-g/rm-cstyle-cmts/blob/9f110983eac55d29ff34e86ca366de450810cde1/src/gulp/index.d.ts#L32) `{true | undefined}` -- Whether preserve whitespace and blank lines. Default: `undefined`.\n- [**renderProgress**](https://github.com/jeffy-g/rm-cstyle-cmts/blob/9f110983eac55d29ff34e86ca366de450810cde1/src/gulp/index.d.ts#L40) `{true | undefined}` -- log scan source path(relative) currently being processed. Default: `undefined`.\n- [**collectRegex**](https://github.com/jeffy-g/rm-cstyle-cmts/blob/9f110983eac55d29ff34e86ca366de450810cde1/src/gulp/index.d.ts#L44) `{true | undefined}` -- Whether collect detected regex. Default: `undefined`.\n- [**isWalk**](https://github.com/jeffy-g/rm-cstyle-cmts/blob/9f110983eac55d29ff34e86ca366de450810cde1/src/gulp/index.d.ts#L50) `{true | undefined}` -- Whether to run in walkthrough mode. Default: `undefined`.\n- [**extraExtensions**](https://github.com/jeffy-g/rm-cstyle-cmts/blob/9f110983eac55d29ff34e86ca366de450810cde1/src/gulp/index.d.ts#L56) `{string[] | undefined}` -- Add additional extensions. Default: `undefined`.\n- [**disableDefaultExtensions**](https://github.com/jeffy-g/rm-cstyle-cmts/blob/9f110983eac55d29ff34e86ca366de450810cde1/src/gulp/index.d.ts#L72) `{true | undefined}` -- use `extraExtensions` only, instead of `defaultExtensions`. Default: `undefined`.\n  + `defaultExtensions` - \".js\", \".jsx\", \".ts\", \".tsx\", \".cjs\", \".mjs\", \".cts\", \".mts\"\n- [**timeMeasure**](https://github.com/jeffy-g/rm-cstyle-cmts/blob/9f110983eac55d29ff34e86ca366de450810cde1/src/gulp/index.d.ts#L78) `{true | undefined}` -- Whether to record the processing time for each file (replace mode only). Default: `undefined`.\n\n#### example with `scan listener`\n\n```js\nconst gulp = require(\"gulp\"); \nconst grmc = require(\"rm-cstyle-cmts/cjs/gulp/\");\n\n// set scan event listener\ngrmc.getRmcInterface().setListener(({ event, fragment, offset }) =\u003e {\n    if (event === /*EScannerEvent.MultiLineComment*/1) {\n        // true: Concatenate fragment to result in \"remove mode\", continue walkthrough in \"walkthrough mode\".\n        // false: remove fragment in \"remove mode\", stop walkthrough in \"walkthrough mode\".\n        return /^\\/\\*(\\*|!)\\s/.test(fragment);\n    }\n    else if (event === /*EScannerEvent.SingleLineComment*/0) {\n        return /(?:\\/\\/\\/?\\s+@ts-\\w+|\\/\\/\\/\\s*\u003creference)/.test(fragment);\n    }\n    // remove fragment in \"remove mode\", stop walkthrough in \"walkthrough mode\".\n    return false;\n});\n\ngulp.src([\"./src/**/*.{js,jsx,ts,tsx}\"]).pipe(\n    /**\n     * preserveBlanks : keep blank line and whitespaces, default is `undefined`.\n     */\n    grmc.getTransformer({\n        preserveBlanks: undefined, // remove blank lines and trailing whitespace\n        renderProgress: true,      // show progress\n        // isWalk: true // want walk through?\n    })\n).pipe(gulp.dest(\"./tmp\"));\n```\n\n## rm-cstyle-cmts web version\n\n+ You can use web version from cdn such as `jsdelivr`.\n  + can use the API through the `Rmc` global variable.\n\n```html\n\u003c!-- or https://cdn.jsdelivr.net/npm/rm-cstyle-cmts@latest/umd/index.min.js --\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/rm-cstyle-cmts@3/umd/index.min.js\"\u003e\u003c/script\u003e\n```\n\n```js\nconst source = `\n///  \u003creference types=\"node\"/\u003e\n\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\n\n/**\n * jsdoc comment\n */\nfunction App() {\n  return (\n    // TODO: can optionally include quote string in react syntax.\n    // such source input does not complete successfully.\n    \u003ch1\u003eHello's world's\u003c/h1\u003e\n  );\n}\n\nReactDOM.render(\u003cApp /\u003e, document.getElementById(\"root\"));\n`;\n\n/**\n * You can use the API through the `Rmc` global variable.\n */\nconsole.log(Rmc(source));\n// print detected regex literals detail (in this case, nothing any result)\nconsole.log(Rmc.getDetectedReContext());\n// reset of related statistics\nRmc.reset();\n```\n\n## usage\n\n\u003e #### Case: single line input (js)\n\n```js\nconst rmc = require(\"rm-cstyle-cmts\");\nconst input = \"    /** block comment */ const a = \\\"this is apple! \\\\n\\\", b = 'quoted \\\"strings\\\"', \\\nc = `list:\\\\n1. \\${a}\\\\n2. \\${b}\\\\n\\${ /* comments */ ` - len: \\${a.length + b.length}`}\\\\n ---`;  \\\n/* . */  let i = 2, n = 12 / 4 * 7/i; // last coment.  !\";\n\nconst result = rmc(input);\nconsole.log(result);\n//\u003e const a = \"this is apple! \\n\", b = 'quoted \"strings\"', c = `list:\\n1. ${a}\\n2. ${b}\\n${ /* comments */ ` - len: ${a.length + b.length}`}\\n ---`;    let i = 2, n = 12 / 4 * 7/i;\n```\n\n\u003e #### Case: json source\n```js\nconst rmc = require(\"rm-cstyle-cmts\");\nconst json = `// see: http://json.schemastore.org/tsconfig\n{\n  \"compilerOptions\": {\n    /* Basic Options */\n    \"target\": \"es5\",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */\n    \"module\": \"commonjs\",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */\n    // \"allowJs\": true,                       /* Allow javascript files to be compiled. */\n    // \"checkJs\": true,                       /* Report errors in .js files. */\n    // \"declaration\": true,                   /* Generates corresponding '.d.ts' file. */\n    // \"sourceMap\": true,                     /* Generates corresponding '.map' file. */\n    // \"outFile\": \"./\",                       /* Concatenate and emit output to single file. */\n    // \"outDir\": \"./\",                        /* Redirect output structure to the directory. */\n\n    /* Strict Type-Checking Options */\n    \"strict\": true,                           /* Enable all strict type-checking options. */\n    // \"strictNullChecks\": true,              /* Enable strict null checks. */\n    // \"strictFunctionTypes\": true,           /* Enable strict checking of function types. */\n\n    /* Additional Checks */\n    // \"noUnusedLocals\": true,                /* Report errors on unused locals. */\n    // \"noUnusedParameters\": true,            /* Report errors on unused parameters. */\n\n    /* Module Resolution Options */\n    // \"baseUrl\": \"./\",                       /* Base directory to resolve non-absolute module names. */\n    // \"typeRoots\": [],                       /* List of folders to include type definitions from. */\n    \"esModuleInterop\": true                   /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */\n\n    /* Experimental Options */\n    // \"experimentalDecorators\": true,        /* Enables experimental support for ES7 decorators. */\n    // \"emitDecoratorMetadata\": true,         /* Enables experimental support for emitting type metadata for decorators. */\n  },\n  \"files\": [\n    \"y\"\n  ]\n}`;\n\nconst result = rmc(input);\nconsole.log(result);\n//\u003e {\n//\u003e   \"compilerOptions\": {\n//\u003e     \"target\": \"es5\",\n//\u003e     \"module\": \"commonjs\",\n//\u003e     \"strict\": true,\n//\u003e     \"esModuleInterop\": true\n//\u003e   },\n//\u003e   \"files\": [\n//\u003e     \"y\"\n//\u003e   ]\n//\u003e }\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffy-g%2Frm-cstyle-cmts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeffy-g%2Frm-cstyle-cmts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffy-g%2Frm-cstyle-cmts/lists"}