{"id":19912684,"url":"https://github.com/biati-digital/better-concat","last_synced_at":"2026-05-13T06:34:50.660Z","repository":{"id":57148269,"uuid":"184833859","full_name":"biati-digital/better-concat","owner":"biati-digital","description":"concatenate multiple files and folders","archived":false,"fork":false,"pushed_at":"2019-05-04T02:42:23.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T22:47:13.191Z","etag":null,"topics":["concat","javascript","merge","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/biati-digital.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}},"created_at":"2019-05-04T00:02:15.000Z","updated_at":"2019-05-04T04:00:13.000Z","dependencies_parsed_at":"2022-09-05T16:51:16.070Z","dependency_job_id":null,"html_url":"https://github.com/biati-digital/better-concat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biati-digital%2Fbetter-concat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biati-digital%2Fbetter-concat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biati-digital%2Fbetter-concat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biati-digital%2Fbetter-concat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biati-digital","download_url":"https://codeload.github.com/biati-digital/better-concat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241341722,"owners_count":19947104,"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":["concat","javascript","merge","nodejs"],"created_at":"2024-11-12T21:29:58.629Z","updated_at":"2026-05-13T06:34:50.593Z","avatar_url":"https://github.com/biati-digital.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Better Concat\n\nConcatenate multiple files and folders\n\n## Install\n```\n$ npm install better-concat\n```\n```\nimport concat from 'better-concat'\n```\n\n## Usage\n\n### The most simple use\n```javascript\nawait concat({\n    files: ['file1.js', 'file2.js', ...],\n    out: 'out.js',\n})\n```\n\n### Concat files and folders\nYou can pass folders in the files array and those folders will be scanned and all the contained files will be merged respecting the order.\n```javascript\nawait concat({\n    files: ['file1.js', 'folder1', 'folder2', 'file2.js', ...],\n    out: 'out.js',\n})\n```\n\n### Exclude certain files\nIf you pass folders in the files list you can use the exclude option to decide wich files are excluded.\nExclude can be an array of the files to ignore or a function\n\n```javascript\n// List example\nawait concat({\n    files: ['file1.js', 'folder1', 'folder2', 'file2.js', ...],\n    exclude: ['package.json'],\n    out: 'out.js',\n})\n\n// Function example\nawait concat({\n    files: ['file1.js', 'folder1', 'folder2', 'file2.js', ...],\n    exclude: (file, path) =\u003e {\n        if (file == 'package.json') {\n            return true; //exclude this file\n        }\n        return false;\n    },\n    out: 'out.js',\n})\n```\n\n### Manipulate individual files strings before merge\nYou can manipulate individual file strings before the string is merged\n```javascript\nawait concat({\n    files: ['file1.js', 'folder1', 'folder2', 'file2.js', ...],\n    fileStr: (str, path) =\u003e {\n        if (path.endsWith('package.json')) {\n            return str.replace('word', '');\n        }\n        return str;\n    },\n    out: 'out.js',\n})\n```\n\n\n### Manipulate the complete merged string before it's saved\nYou can manipulate the merged string with a function.\n```javascript\nawait concat({\n    files: ['file1.js', 'folder1', 'folder2', 'file2.js', ...],\n    outStr: (str) =\u003e {\n        return str.replace('word', '');\n    },\n    out: 'out.js',\n})\n```\n\n### Return the merged string\nInstead of saving the merged string in a file you can save it in a variable and do whatever you want\n```javascript\nconst concateStr = await concat({\n    files: ['file1.js', 'folder1', 'folder2', 'file2.js', ...],\n    out: false,\n})\n```\n\n### All available options\n```javascript\nconst concateStr = await concat({\n    files: ['file1.js', 'folder1', ...],\n    out: 'path to save the merged file or false',\n    exclude: 'list of files to exclude or function',\n    invisibles: 'include invisible files if passed folders in files list (false by default)',\n    outStr: 'function to manipulate the string before it\\'s saved or returned',\n    fileStr: 'function to manipulate the string of individual files',\n    delimiter: 'delimiter used to merge the files, default is \\n leave empty to remove all line breaks'\n})\n```\n\n## If you like this\n\n:star: this repo\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2019 biati digital\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiati-digital%2Fbetter-concat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiati-digital%2Fbetter-concat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiati-digital%2Fbetter-concat/lists"}