The short answer is yes, though strictly speaking, it depends on what you mean by "JavaScript".
The ECMAScript standards which define the JS language itself don't cover file access, simply because JS has evolved as a language embedded in contexts like browsers, from which the file system has to be protected.
Particular embeddings of JS however, (JXA, Node.js) do provide libraries which define their own file system functions.
Using the JXA Automation library on macOS for example, we can write things like:
// readFile :: FilePath -> IO String
const readFile = fp => {
// The contents of a text file at the
// filepath fp.
const
e = $(),
ns = $.NSString
.stringWithContentsOfFileEncodingError(
$(fp).stringByStandardizingPath,
$.NSUTF8StringEncoding,
e
);
return ObjC.unwrap(
ns.isNil() ? (
e.localizedDescription
) : ns
);
};
and
// writeFile :: FilePath -> String -> IO ()
const writeFile = fp => s =>
$.NSString.alloc.initWithUTF8String(s)
.writeToFileAtomicallyEncodingError(
$(fp)
.stringByStandardizingPath, false,
$.NSUTF8StringEncoding, null
);
For really huge CSV files (several gigabytes), I've found buffered processing through the Python CSV library rather fast and painless, and that too is accessible from within the work-flow of a KM macro.
And more generally, as @JMichaelTX says, all of the data transforms in that package can be written as JavaScript functions.
(It's possible that it may actually be implemented in JavaScript – I notice that for fuller flexibility it allows you to add your own JS code in a 'JavaScript Transform', so perhaps that is the idiom, under the hood, of the other functions/transforms too).