0

I have been trying to figure out how to add add timestamp to Atom Snippets.

'.text.plain':  
  'Timestamp':  
    'prefix': 'isoT'
    'body': 'new Date().toISOString()'

This just prints the text and without ' it throws an error.
Is it possible to add javascript to an Atom snippet?

1 Answer 1

1

This is not possible. Snippets are stored in a CSON file, which is CoffeeScripts equivalent of JSON.

In all likelyhood, there already exists a package that inserts a timestamp. Otherwise, with knowledge of JavaScript, it's fairly easy to write your own. Take note that all commands provided by a package can be bound to a keystroke.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.