sb1 how to do a beep and blink led from js ?

How to perform a beep and blink led from javascript to indicate a error to the user when we scanning a barcode ?

With no header or accessories !