{"id":23714803,"url":"https://github.com/happycoda/grunt-remote-exists","last_synced_at":"2026-02-09T13:30:18.754Z","repository":{"id":57255604,"uuid":"51027862","full_name":"happyCoda/grunt-remote-exists","owner":"happyCoda","description":"Grunt plugin to check remote file existence","archived":false,"fork":false,"pushed_at":"2016-02-05T15:41:10.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T06:16:04.078Z","etag":null,"topics":["grunt","grunt-plugins","plugins"],"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/happyCoda.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":"2016-02-03T20:21:00.000Z","updated_at":"2017-05-04T22:23:28.000Z","dependencies_parsed_at":"2022-09-04T23:01:20.544Z","dependency_job_id":null,"html_url":"https://github.com/happyCoda/grunt-remote-exists","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/happyCoda%2Fgrunt-remote-exists","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happyCoda%2Fgrunt-remote-exists/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happyCoda%2Fgrunt-remote-exists/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happyCoda%2Fgrunt-remote-exists/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/happyCoda","download_url":"https://codeload.github.com/happyCoda/grunt-remote-exists/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239801203,"owners_count":19699299,"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":["grunt","grunt-plugins","plugins"],"created_at":"2024-12-30T20:38:03.921Z","updated_at":"2026-02-09T13:30:18.720Z","avatar_url":"https://github.com/happyCoda.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-remote-exists\n\n\u003e Check if file exists on remote server\n\n## Getting Started\nThis plugin requires Grunt `~0.4.5`\n\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:\n\n```shell\nnpm install grunt-remote-exists --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-remote-exists');\n```\n\n## The \"remote_exists\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `remote_exists` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  remote_exists: {\n    options: {\n      operation: null,\n      connectOpts: {\n        host: 'hostname',\n        port: 22,\n        username: 'username',\n        passphrase: 'passphrase',\n        privateKey: 'privateKey'\n      }\n    },\n    your_target: {\n      src: ['/remote/path/to/file']\n    },\n  },\n});\n```\n\n### Options\n\n#### filePath\nType: `String`\nDefault value: `none`\n\nA path to file on a remote server to check if it exists.\n\n#### operation\nType: `String` of `null`\nDefault value: `null`\n\nString which tells plugin whether it should create, remove or just check file.\n\n#### connectOpts\nType: `Object` of `null`\nDefault value: `null`\n\nAn object with ssh connection params.\n\n### Usage Examples\n\n#### Just checking\nIn this example, the default options for file creation are used. So the file specified in `filePath` will be checked on the remote `host`, and result of this checking will be outputted to the console.\n\n```js\ngrunt.initConfig({\n  remote_exists: {\n    options: {\n      filePath: '/remote/path/to/file',\n      connectOpts: {\n        host: 'hostname',\n        port: 22,\n        username: 'username',\n        passphrase: 'passphrase',\n        privateKey: 'privateKey'\n      }\n    }\n  }\n});\n```\n\n#### Write\nIf `filePath` does not exist, it will be created since `touch` option is enabled. Checking results will be outputted as well.\n\n```js\ngrunt.initConfig({\n  remote_exists: {\n    options: {\n      operation: 'touch',\n      connectOpts: {\n        host: 'hostname',\n        port: 22,\n        username: 'username',\n        passphrase: 'passphrase',\n        privateKey: 'privateKey'\n      }\n    },\n    default_config: {\n      src: ['/remote/path/to/file']\n    }\n  }\n});\n```\n\n#### Remove\nIf `filePath` exists, it will be removed, nothing will be done otherwise. Checking results will be outputted as well.\n\n```js\ngrunt.initConfig({\n  remote_exists: {\n    options: {\n      operation: 'rm',\n      connectOpts: {\n        host: 'hostname',\n        port: 22,\n        username: 'username',\n        passphrase: 'passphrase',\n        privateKey: 'privateKey'\n      }\n    },\n    default_config: {\n      src: ['/remote/path/to/file']\n    }\n  }\n});\n```\n\n## Release History\n* 2016-02-05   v1.1.0   Tests are rewritten. File removal bug fixed. Multiple file support added.\n* 2016-02-04   v1.0.0   All logic completely rewritten.\n* 2016-02-03   v0.1.0   First official release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappycoda%2Fgrunt-remote-exists","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhappycoda%2Fgrunt-remote-exists","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappycoda%2Fgrunt-remote-exists/lists"}