This is a part of the series: LocalPen - code pens that run locally!
Now you have written your code, how it save/export it?
Projects can be locally saved to device using local storage. You can save a project by clicking
Save on the settings menu, or simply with the keyboard shortcut
Ctrl/Cmd + S.
After the initial save, autosave is enabled so that you do not lose code changes. You may disable autosave from the settings menu. It will remain disabled till the next save.
You may also fork the project (save as a new project). Also from the settings menu > Fork, or the keyboard shortcut
Ctrl/Cmd + Shift + S.
Previously saved projects can be opened from the settings menu > Open. In that screen you can open/delete any project or delete all.
Please note that the projects are locally saved on the device and are not uploaded to the server.
Projects in LocalPen can be exported as:
- JSON: this is a JSON representation of the project configuration with the project source code included. This allows re-importing or sharing your projects.
- Source: The source code is exported as separate files in a single zip file. This is your untouched source code which you may wish to open in another code editor.
- Result: The combined compiled/transpiled code is exported as a ready-to-run HTML file. You may run it by simply opening the file in the browser, or using a simple local http server, for example:
It is planned to support more services. This allows you to move code between different services.
Proceed to the next post for how to prefill editors with code (import code to editors)