sparkar-volts
Version:
An extensive non-reactive Typescript framework that eases the development experience in Spark AR
78 lines (50 loc) • 3.48 kB
Markdown
# VOLTS ⚡️
[](https://www.npmjs.com/package/sparkar-volts) [](https://github.com/tomaspietravallo/sparkar-volts/actions/workflows/test.yml) 
An extensive Typescript framework that eases the development experience in Spark AR
## Showcase ✨
[See an example of what can be built with Volts 4.0.0](https://www.facebook.com/groups/SparkARcommunity/posts/1411088659303172/)
## Highlights
- This framework takes an imperative approach, and tries to abstract away the SparkAR Reactive API as much as possible
- Typescript: You'll have a smoother and richer experience while developing. [Use VSC to take full advantage, with autocompletion and intellisense](https://sparkar.facebook.com/ar-studio/learn/scripting/scripting-basics/#scripting-fundamentals)
> Please make sure to read this list of reasons why you should prefer the ReactiveAPI over vanilla js: [Reactive programming, SparkAR](https://sparkar.facebook.com/ar-studio/learn/scripting/reactive/) before using `volts`, as it might not be the right thing for every project
## Documentation
[Check out our documentation!](https://tomaspietravallo.gitbook.io/sparkar-volts/)
### How to add VOLTS to your project
[Read this installation guide](https://tomaspietravallo.gitbook.io/sparkar-volts/install)
### How to use
[Read this guide on getting started with VOLTS](https://tomaspietravallo.gitbook.io/sparkar-volts/how-to-use-volts)
## Template
You can use this template as a quick start if you're already familiar with the library. Download using the command:
```bash
npm i sparkar-volts
```
Or using [this download link](https://github.com/tomaspietravallo/sparkar-volts/releases/latest/download/volts.ts)
```typescript
// main.ts
// using sparkar-volts@4.0.0
import Diagnostics from 'Diagnostics';
import Volts, { PublicOnly } from './volts';
const World = Volts.World.getInstance({
mode: 'DEV',
snapshot: {},
assets: {},
loadStates: undefined,
});
World.onEvent('load', function (this: PublicOnly<typeof World>, snapshot) {
Diagnostics.log(`Loaded 🧪.\nAssets: ${Object.keys(World.assets) || 'no assets were loaded'}`);
});
World.onEvent('frameUpdate', function (this: PublicOnly<typeof World>, snapshot, data) {
if (data.frameCount == 0) Diagnostics.log(`Running... 🚀\n`);
});
```
## Contributing ❤️
 
You can contribute to the development of VOLTS.
PRs & Issues welcomed!
Check the [issues](https://github.com/tomaspietravallo/sparkar-volts/issues) to see if there's anything that requires help, or want to discuss aspects of the project — feel free to open an issue if you encounter a bug/ want to request a feature/ other
> Please check the [contributing.md](contributing.md) file if you wish to contribute to the development of the project.
>
> If you want to open a PR/Issue, please make sure to read the [code-of-conduct.md](code-of-conduct.md) before doing so.
### Donations
All proceeds will be split amongst all major contributors
[](https://www.paypal.com/donate?hosted_button_id=LEXFVQET96N2Y)