
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
livescript-transform-esm
Advanced tools
Transform for livescript adding support for modules.
Repository on github
First install livescript and transfrom-esm
npm i -D https://github.com/gkz/LiveScript livescript-transform-esm
to transpile from src to tmp
node_modules/.bin/lsc -r livescript-transform-esm/register -c -o tmp src
to run script use CommonJS module format option e.g. running test/index.ls
node -r livescript-transform-esm/register/cjs -c -o tmp src
This plugin comes equiped with some extra features which won't be seen in js-land any time soon.
Tired of manual polluting scope with hundreds of identifiers, let compiler do it for you. (for now only relative module are resolved)
import ...
'./symbols'
import
'./symbols' : ...
both generate
import { init, create } from './symbols';
Importing multiple files never was so easy, you can pass any string compatible with globby and compiler will do the rest. Globs are expanded during compilation making them transparent for other tools and browser.
import 'modules/**'
import foo from './modules/foo';
import Math from './modules/Math';
import Vector from './modules/Vector';
If you've ever wanted to generated index file base on content of directory it is trivial with this plugin, take export, import, some glob mix the together and here you have:
# inside of modules there are: foo.ls, Match.ls, Vector.ls
export { import './modules/**' }
import import$ from './modules/foo';
import import1$ from './modules/Math';
import import2$ from './modules/Vector';
export { import$ as foo }
export { import1$ as Math }
export { import2$ as Vector }
Guys in js-land need to put imports into top scope otherwise its gives theme nice shinny error. But we don't like to obey those silly rules and we can but imports wherever it will make sense.
export default config =
plugins: [
import \livescript-transform-object-create
import \livescript-transform-esm
import \livescript-transform-implicit-async
import \livescript-transform-object-create/lib/plugin
import \livescript-transform-esm/lib/plugin
import \livescript-transform-implicit-async/lib/plugin
]
import import$ from 'livescript-transform-object-create';
import import1$ from 'livescript-transform-esm';
import import2$ from 'livescript-transform-implicit-async';
import import3$ from 'livescript-transform-object-create/lib/plugin';
import import4$ from 'livescript-transform-esm/lib/plugin';
import import5$ from 'livescript-transform-implicit-async/lib/plugin';
var config;
export { config as default }
config = {
plugins: [import$, import1$, import2$, import3$, import4$, import5$]
};
A riddle: how to make dynamic import?
Answer: async it
foo = async import \./modules/foo
vector-path = \./modules/Vector
Vector = async import vector-path
var foo, vectorPath, Vector;
foo = import('./modules/foo');
vectorPath = './modules/Vector';
Vector = import(vectorPath);
import all
\react
\./symbols
import * as symbols from './symbols';
import * as react from 'react';
If you are using Atom editor you may be interested in my packages which provide realtime code preview supporting this plugin.

If you are using Webpack you can try my loader whith support for this and other plugins.
FAQs
Livescript plugin enabling es modules in generated code
The npm package livescript-transform-esm receives a total of 12 weekly downloads. As such, livescript-transform-esm popularity was classified as not popular.
We found that livescript-transform-esm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.