I’m trying to use node to use the photoshop api, I am currently trying to make a code based on the example of text edit, but, I can’t deal with the fs.readFileSync, I need to use this to to configurate my private key, for that, I need to put the path to my key, but It says “module bot found”
fs.readFileSync("C:UsersjpcamOneDriveÁrea de TrabalhopsdTesteprivate.key"),
I don’t know what I can do to this work
Can anyone help me?
I ve tried using also only the file name of the key, because the Kay and the code are in the same folder
2
Answers
make sure that the key file and your script file are in the same folder and try this
In Javascript, the backslash is used as the escape character. For example,
n
makes a newline character.If you do
console.log("C:UsersjpcamOneDriveÁrea de TrabalhopsdTesteprivate.key")
you’ll notice that the result isC:UsersjpcamOneDriveÁrea de TrabalhopsdTesteprivate.key
.Escape the escape character to get a backslash:
Alternatively, you can use
String.raw()
with a tagged template string:Template literal strings use backticks, not single quotes.