https://github.com/demipixel/factorio-blueprint
Import and Export blueprint strings automagically with this handy dandy blueprint API
https://github.com/demipixel/factorio-blueprint
factorio
Last synced: about 1 month ago
JSON representation
Import and Export blueprint strings automagically with this handy dandy blueprint API
- Host: GitHub
- URL: https://github.com/demipixel/factorio-blueprint
- Owner: demipixel
- License: mit
- Created: 2016-05-17T04:42:27.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-05-20T22:15:09.000Z (almost 2 years ago)
- Last Synced: 2025-10-12T21:24:09.810Z (5 months ago)
- Topics: factorio
- Language: TypeScript
- Size: 852 KB
- Stars: 109
- Watchers: 4
- Forks: 29
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# factorio-blueprint
[](https://badge.fury.io/js/factorio-blueprint)
[](https://travis-ci.org/demipixel/factorio-blueprint)
A node.js library created to help you create, modify, and export Factorio blueprints and blueprint strings!
This library supports simple tasks such as adding or removing entities to more complex tasks such as connecting
entities via wires and modifying combinators.
See docs [here](https://demipixel.github.io/factorio-blueprint).
## Getting Started
### Website Usage
If you want to use this on a site, you can access the latest build in /dist
### Install via NPM
```
$ npm install factorio-blueprint
```
### Basic Usage
```js
const Blueprint = require('factorio-blueprint');
// Create a blueprint with nothing in it
const myBlueprint = new Blueprint();
// Import a blueprint using a blueprint string
const importedBlueprint = new Blueprint(blueprintString);
// Modify the blueprint!
myBlueprint.createEntity('transport-belt', { x: 0, y: 0 }, Blueprint.UP);
importedBlueprint.entities[0].remove();
// Export the string to use in-game
console.log(myBlueprint.encode());
```
## [Click here for full documentation!](https://demipixel.github.io/factorio-blueprint)