Logic for JavaScript modules