{"id":16982564,"url":"https://github.com/romancow/nosync","last_synced_at":"2025-04-12T02:21:23.728Z","repository":{"id":51108765,"uuid":"236098749","full_name":"romancow/nosync","owner":"romancow","description":"Prevent files and folders from syncing with iCloud","archived":false,"fork":false,"pushed_at":"2022-04-27T04:18:34.000Z","size":34,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T22:01:59.658Z","etag":null,"topics":["icloud","icloud-drive","icloud-sync","node","node-modules","symlink","sync"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romancow.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":"2020-01-24T23:07:05.000Z","updated_at":"2024-09-29T20:00:46.000Z","dependencies_parsed_at":"2022-09-04T02:20:23.812Z","dependency_job_id":null,"html_url":"https://github.com/romancow/nosync","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romancow%2Fnosync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romancow%2Fnosync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romancow%2Fnosync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romancow%2Fnosync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romancow","download_url":"https://codeload.github.com/romancow/nosync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505921,"owners_count":21115354,"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":["icloud","icloud-drive","icloud-sync","node","node-modules","symlink","sync"],"created_at":"2024-10-14T02:08:43.594Z","updated_at":"2025-04-12T02:21:23.695Z","avatar_url":"https://github.com/romancow.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n#\tNo Sync\n- [About](#About)\n- [Installation](#Installation)\n- [Usage](#Usage)\n\t- [Programmatic](#Programmatic)\n\t- [Command Line](#Command-Line)\n- [Links](#Links)\n- [License](#License)\n\n## About\n\nA tool to prevent files and folders from syncing to iCloud.\n\nIt does this by creating a folder named \".nosync\" (which iCloud will not sync) to hold the unsynced files\nand symlinking to them from the original location.\n\nThis can come in handy, for example, if you want to keep node packages on iCloud, but don't want it to sync\nall their `node_modules` folders.\n\nIf the file or folder already exists, `nosync` will move it to the unsynced location, then create a\nsymlink pointing to it with the original location and name. If a file or folder does not exist at the\nspecified location, a symlink is created that points to a new folder at the unsynced location.\n\n## Installation\n\nAdd a scope mapping for the GitHub npm package manager by adding a `.npmrc` file with the line:\n\n\t@romancow:registry=https://npm.pkg.github.com/\n\nThen install the package:\n\n\tnpm install @romancow/nosync\n\nor\n\n\tyarn add @romancow/nosync\n\nMore info on using the GitHub npm package registry [here](https://help.github.com/en/articles/configuring-npm-for-use-with-github-package-registry#installing-a-package).\n\nYou might also want to add your nosync folder (\".nosync\" by default) to your .gitignore since things you don't want to sync are typically also things you don't want in git.\n\n## Usage\n\n### Programmatic\n\nTheres is one function to import:\n```javascript\nconst nosync = require('@romancow/nosync');\n```\n\nOr with ES modules:\n```javascript\nimport nosync from '@romancow/nosync';\n```\n\nThe `nosync` function accepts a single path or an array of paths to not sync:\n```javascript\n// symlinks \"node_modules\" to \".nosync/node_modules\" in the current working directory\nnosync(\"./node_modules\")\n\n// symlinks \"build\" to \".nosync/build\", \"dist\" to \".nosync/dist\", and \"types\" to \".nosync/types\"\nnosync([\"./build\", \"./dist\", \"./types\"])\n```\n\nIt can also accept an object mapping paths to where they should be located within\nthe `.nosync` folder:\n```javascript\nnosync({\n\t// symlinks \"es6\" to \".nosync/artifacts/build\"\n\t\"es6\": \"artifacts/build\",\n\n\t// symlinks \"cjs\" to \".nosync/artifacts/dist\"\n\t\"cjs\": \"artifacts/dist\",\n\n\t// symlinks \"types\" to \".nosync/artifacts/types\"\n\t\"types\": \"artifacts/types\"\n})\n```\n\n#### Options\n\nThe `nosync` function also accepts a second `options` argument.\n\nThere are currently three options:\n\n\u003cdl\u003e\n\t\u003cdt\u003ebase\u003c/dt\u003e\n\t\u003cdd\u003eThe folder to copy unsynced files and folders to. Defaults to `./.nosync`. Note that in order for\n\tiCloud to ignore it, it be named something iCloud ignores (such as containing \".nosync\"). You could,\n\thowever, point it to a folder outside of iCloud drive to prevent syncing.\u003c/dd\u003e\n\t\u003cdt\u003echeck\u003c/dt\u003e\n\t\u003cdd\u003eIf true, will only copy and symlink files if the path includes the iCloud drive folder. If false,\n\tit won't check iCloud status. Default is false.\u003c/dd\u003e\n\t\u003cdt\u003eoverwrite\u003c/dt\u003e\n\t\u003cdd\u003eIf a file or folder exists at the given path and already exists in the nosync folder, this option\n\tdetermines whether or not to overwrite the one in the nosync folder. Default is false.\u003c/dd\u003e\n\u003c/dl\u003e\n\n```javascript\nnosync({ \"node_modules\": \"node_modules.nosync\" }, { base: \"./\", check: true, overwrite: true })\n```\n\n### Command Line\n\nNo Sync can also be used on the command line:\n\n\tnosync node_modules\n\nYou can pass multiple paths:\n\n\tnosync build dist types\n\nOr pass options:\n\n\tnosync node_modules --check\n\nSupported options are (check [above](#Options) for what they do):\n\n\u003cdl\u003e\n\t\u003cdt\u003e-V, --version\u003c/dt\u003e\n\t\u003cdd\u003eoutput the version number\u003c/dd\u003e\n\t\u003cdt\u003e-b, --base \u0026ltpath\u0026gt\u003c/dt\u003e\n\t\u003cdd\u003eBase folder to store non-synced files\u003c/dd\u003e\n\t\u003cdt\u003e-c, --check\u003c/dt\u003e\n\t\u003cdd\u003eCheck that files are in iCloud folder\u003c/dd\u003e\n\t\u003cdt\u003e-o, --overwrite\u003c/dt\u003e\n\t\u003cdd\u003eOverwrite existing files in nosync folder\u003c/dd\u003e\n\t\u003cdt\u003e-p, --paths \u0026ltjson file\u0026gt\u003c/dt\u003e\n\t\u003cdd\u003eJSON file with paths to not sync\u003c/dd\u003e\n\t\u003cdt\u003e-s, --silent\u003c/dt\u003e\n\t\u003cdd\u003eSuppresses console information\u003c/dd\u003e\n\t\u003cdt\u003e-h, --help\u003c/dt\u003e\n\t\u003cdd\u003eoutput usage information\u003c/dd\u003e\n\u003c/dl\u003e\n\n#### With npm\n\nSo if you wanted to hide your \"node_modules\" folder from iCloud before calling install on a fresh package,\nyou could do something like this:\n\n\tnosync node_modules \u0026\u0026 npm install\n\nOr if you want check to make sure it's on your iCloud drive before doing it:\n\n\tnosync node_modules -c \u0026\u0026 npm install\n\nOr if initializing a new package:\n\n\tnosync node_modules \u0026\u0026 npm init\n\n#### Using the --paths option\n\nThe `-paths` options allows you to specify a JSON file to use to specify the paths that shouldn't be\nsynced by iCloud:\n\n\tnosync --paths nosync.json\n\nThis allows you to set a configuration file within an actual project, specifying which files and folders\nnot to sync, varying it based on the individual needs of that project. The json can be either an array of\npaths, or an object mapping paths to where they should be located within the `.nosync` folder.\n\nIf paths are specified as both command line arguments and in a json file, then they will all be \"nosynced\".\nIf neither is specified, then `nosync` will look for a paths json file named \"nosync.json\" in the current\nworking directory.\n\n## Links\n\nIf you want to hide your nosync folder in Visual Studio Code's explorer side bar:\n\n\u003e [Hide Unwanted Folders in Visual Studio Code](https://medium.com/@m3lles/how-to-hide-unwanted-folders-and-files-in-visual-studio-code-2bb0f39c4251)\n\n## License\n\n[ISC](https://opensource.org/licenses/ISC)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromancow%2Fnosync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromancow%2Fnosync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromancow%2Fnosync/lists"}