Atom runs on a number of platforms and while Electron and Node take care of many of the details there are still some considerations to ensure your package works on other operating systems.
File symlinks can be used on Windows by non-Administrators by specifying 'junction' as the type (this argument is ignored on macOS & Linux).
prn(regardless of extension, e.g.
\although some tools and PowerShell allow
You can dynamically find out what your platform uses with
path.sep or better yet use the node path library functions such as
normalize which automatically take care of this.
Windows supports up to 250 characters for a path - avoid deeply nested directory structures
URL parsing routines should not be used on file paths. While they initially look like a relative path it will fail in a number of scenarios on all platforms.
?as query string,
#as a fragment identifier
If you need to use a path for a URL use the file: protocol with an absolute path instead to ensure drive letters and slashes are appropriately addressed, e.g.
fs.stat function does not return the size of the contents of a directory but rather the allocation size of the directory itself. This returns 0 on Windows and 1024 on macOS and so should not be relied upon.
path.relativecan be used to calculate a relative path to traverse between any two given paths.
Creation and deletion operations may take a few milliseconds to complete. If you need to remove many files and folders consider RimRAF which has built-in retry logic for this.
autocrlfset which automatically converts between the two
If you are writing specs that use text file fixtures consider that this will interfere with file lengths, hash codes and direct text comparisons. It will also change the Atom selection length by 1 character per line.
If you have spec fixtures that are text files you may want to tell Git to force LF, CRLF or not convert them by specifying the paths in
spec/fixtures/always-crlf.txt eol=crlf spec/fixtures/always-lf.txt eol=lf spec/fixtures/leave-as-is.txt -text