# objj-transpiler

> JavaScript (ECMAScript) and Objective-J compiler with preprocessor

Latest version **1.0.0-10** (published 2022-12-09) · 0 weekly downloads

## Install

```sh
npm install objj-transpiler
pnpm add objj-transpiler
yarn add objj-transpiler
bun add objj-transpiler
```

Provides the command `objjc`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-10 |
| Published | 2022-12-09 |
| First published | 2015-04-20 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=0.10.0 |
| Dependencies | 3 |
| Unpacked size | 427.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Maintainers | mrcarlberg, alfredwarnsater |
| Keywords | source, source code, JavaScript, ECMAScript, Objective-J, preprocessor, pre-processor, pre processor, processor, utility, beautifier, formatter |

## Links

- npm: https://www.npmjs.com/package/objj-transpiler
- Repository: https://github.com/mrcarlberg/ObjJAcornCompiler
- Homepage: http://github.com/mrcarlberg/ObjJAcornCompiler
- Issues: https://github.com/mrcarlberg/ObjJAcornCompiler/issues
- npm.io page: https://npm.io/package/objj-transpiler

## Dependencies (3)

- [acorn-walk](https://npm.io/package/acorn-walk.md) 8.2.0
- [source-map](https://npm.io/package/source-map.md) 0.4.x
- [objj-parser](https://npm.io/package/objj-parser.md) ^1.0.0-1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0-10 (latest) — 2022-12-09
- 1.0.0-9 — 2022-12-08
- 1.0.0-8 — 2022-09-30
- 1.0.0-7 — 2022-09-16
- 1.0.0-6 — 2022-09-16
- 1.0.0-5 — 2022-09-13
- 1.0.0-4 — 2022-09-13
- 1.0.0-3 — 2022-08-26
- 1.0.0-2 — 2022-08-26
- 1.0.0-1 — 2022-08-25
- 0.5.7 — 2021-09-21
- 0.5.6 — 2021-09-14
- 0.5.5 — 2021-09-14
- 0.5.3 — 2021-09-09
- 0.5.2 — 2021-09-08
- … 8 more at https://npm.io/package/objj-transpiler/versions

## README

# ObjJAcornCompiler

A tiny, fast JavaScript and/or [Objective-J][objj] transpiler with built in preprocessor. Written in JavaScript.

[objj]: https://www.cappuccino.dev/learn/objective-j.html

It uses a parser extended from the [Acorn][objj-transpiler] JavaScript parser by Marijn Haverbeke.

[objj-transpiler]: https://github.com/cappuccino/objj-transpiler


## Preprocessor

The parser has a built in C like preprocessor.

Example:
```c++
#define MAX(x, y) (x > y ? x : y)
var m1 = MAX(a, b);
var m2 = MAX(14, 20);
```
Will be compiled to:
```c++
var m1 = a > b ? a : b;
var m2 = 14 > 20 ? 14 : 20;
```
For more info see [this][blogpost] blogpost on the Cappuccino website.

[blogpost]: https://www.cappuccino.dev/blog/2013/05/the-new-objective-j-2-0-compiler.html

## Usage


```
    --module                        Set the source type to module instead of script in
                                    the parser.

    --ecma5, --ecma8, --latest      Sets the set version of ECMAScript used be the parser.

    --loose                         Sets the parser to use loose mode.

    --preserve-paren                Tells the parser to preserve parentheses, even if
                                    unnecessary.

    --strict-semicolons             ???

    --no-allow-trailing-commas      ???

    --track-comments                ???

    --include-comment-line-break    ???

    --include-comments              ???

    --track-spaces                  ???

    --track-locations               ???

    --no-objj                       Turns off the parsing of Objective-J.

    --no-preprocess                 Turns off the parsing of preprocessor directives.

    --silent                        ???

    --old-safari-bug                ???

    --no-code                       ???

    --ast                           Generates the intermediate AST as a JSON file.

    --source-map                    ???

    --no-debug-symbols              ???

    --no-type-signatures            ???

    --no-inline-msgsend             ???

    --indent-width                  ???

    --indent-string                 ???

    --indent-tab                    ???

    --output, -o

    -D                              ???

    --help                          ???

    -                               ???
````

## Limitations
It can't compile Objective-J code that depends on other Objective-J files. The Objective-J load and
runtime is needed for this. But it will work as long as you declare any superclass in the same file.

---
_Source: https://npm.io/package/objj-transpiler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
