{"id":25376789,"url":"https://github.com/terrierscript/grunt-lineending","last_synced_at":"2026-03-03T02:39:08.252Z","repository":{"id":7471374,"uuid":"8819244","full_name":"terrierscript/grunt-lineending","owner":"terrierscript","description":"Grunt plugin for change line ending","archived":false,"fork":false,"pushed_at":"2016-12-15T11:14:35.000Z","size":23,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-15T08:09:48.862Z","etag":null,"topics":[],"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/terrierscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-16T13:37:38.000Z","updated_at":"2016-12-15T11:12:35.000Z","dependencies_parsed_at":"2022-07-09T16:16:51.643Z","dependency_job_id":null,"html_url":"https://github.com/terrierscript/grunt-lineending","commit_stats":null,"previous_names":["suisho/grunt-lineending"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/terrierscript/grunt-lineending","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fgrunt-lineending","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fgrunt-lineending/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fgrunt-lineending/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fgrunt-lineending/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terrierscript","download_url":"https://codeload.github.com/terrierscript/grunt-lineending/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fgrunt-lineending/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30030829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T00:31:48.536Z","status":"online","status_checked_at":"2026-03-03T02:00:07.650Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-02-15T04:39:19.106Z","updated_at":"2026-03-03T02:39:08.223Z","avatar_url":"https://github.com/terrierscript.png","language":"JavaScript","readme":"# grunt-lineending [![Build Status](https://travis-ci.org/suisho/grunt-lineending.png?branch=master)](https://travis-ci.org/suisho/grunt-lineending)\r\n\r\n\u003e Convert line ending like `dos2unix` ( or `unix2dos`) command on Grunt.\r\n\r\n\r\n## Getting Started\r\nThis plugin requires Grunt `~0.4.0`\r\n\r\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\r\n\r\n```shell\r\nnpm install grunt-lineending --save-dev\r\n```\r\n\r\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\r\n\r\n```js\r\ngrunt.loadNpmTasks('grunt-lineending');\r\n```\r\n\r\n*This plugin was designed to work with Grunt 0.4.x.*\r\n\r\n\r\n## Lineending task\r\n_Run this task with the `grunt lineending` command._\r\n\r\nTask targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.\r\n\r\n### Overview\r\nIn your project's Gruntfile, add a section named `lineending` to the data object passed into `grunt.initConfig()`.\r\n\r\n### Options\r\n\r\n#### eol\r\nType: `String`  \r\nChoices: `'lf'`, `'cr'`, `'crlf'`  \r\nDefault: `grunt.util.linefeed` value  \r\n\r\n### Usage Examples\r\n\r\n#### Example Config\r\n\r\n```javascript\r\ngrunt.initConfig({\r\n  lineending: {               // Task\r\n    dist: {                   // Target\r\n      options: {              // Target options\r\n        eol: 'crlf'\r\n      },\r\n      files: {                // Files to process\r\n        '/path/to/target': ['test/fixtures/file']\r\n      }\r\n    }\r\n  }\r\n});\r\n\r\ngrunt.loadNpmTasks('grunt-lineending');\r\n\r\ngrunt.registerTask('default', ['lineending']);\r\n```\r\n\r\n#### Default Options\r\nBy default convert line ending to \u003cb\u003elf(\\n)\u003c/b\u003e.\r\n\r\n```js\r\ngrunt.initConfig({\r\n  lineending: {\r\n    your_target: {\r\n      '/path/to/output': ['/path/to/target']\r\n    },\r\n  }\r\n});\r\n```\r\n\r\n#### Convert files manually\r\n```js\r\ngrunt.initConfig({\r\n  lineending: {\r\n    dist: {\r\n      options: {\r\n        eol: 'crlf'\r\n      },\r\n      files: {\r\n        \"./tmp/to_crlf/cr\": [\"./test/fixtures/cr\"],\r\n        \"./tmp/to_crlf/crlf\": [\"./test/fixtures/crlf\"],\r\n        \"./tmp/to_crlf/lf\": [\"./test/fixtures/lf\"]\r\n      }\r\n    }\r\n  }\r\n});\r\n```\r\n\r\n#### Convert all files\r\n```js\r\ngrunt.initConfig({\r\n  lineending: {\r\n    dist: {\r\n      options: {\r\n        eol: 'crlf'\r\n      },\r\n      files: [{\r\n        expand: true,\r\n        cwd: './',\r\n        src: ['test/fixtures/*'],\r\n        dest: 'tmp/to_crlf/'\r\n      }]\r\n    }\r\n  }\r\n});\r\n```\r\n\r\n#### Convert files in-place (overwrite)\r\n(This is experimental option)\r\n\r\nSet `overwrite` option to `true` (default is `false`). The destination is ignored and can be set to `''`.\r\n\r\nThis option only overwrites a source file if the line endings need to be updated otherwise it leaves the file untouched.\r\n\r\n```js\r\ngrunt.initConfig({\r\n  lineending: {\r\n    dist: {\r\n      options: {\r\n        overwrite: true\r\n      },\r\n      files: {\r\n        '': ['test/fixtures/*']\r\n      }\r\n    }\r\n  }\r\n});\r\n```\r\n\r\n## Contributing\r\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\r\n\r\n## Release History\r\n * 2013-05-26 v0.1.1 Remove console.log\r\n * 2013-03-16 v0.1.0 Initial release.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterrierscript%2Fgrunt-lineending","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterrierscript%2Fgrunt-lineending","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterrierscript%2Fgrunt-lineending/lists"}