1 | ## API
|
2 |
|
3 | In this directory you'll find all the public interfaces to using Babel for both
|
4 | node and the browser.
|
5 |
|
6 | ### Node
|
7 |
|
8 | There are two ways people use Babel within Node, they either are manipulating
|
9 | strings of code with `babel.transform` or `babel.parse`, they also might be
|
10 | running their code through Babel before execution via `register` or `polyfill`.
|
11 |
|
12 | ### Browser
|
13 |
|
14 | Usage of Babel in the browser is extremely uncommon and in most cases
|
15 | considered A Bad Idea™. However it works by loading `<script>`'s with XHR,
|
16 | transforming them and then executing them. These `<script>`'s need to have a
|
17 | `type` of "text/ecmascript-6", "text/babel", or "module" ("text/6to5" exists as
|
18 | well for legacy reasons).
|