nano-vscode
nano-vscode is a Visual Studio Code extension that allows users to edit .nano
files in YAML format while saving them as JSON behind the scenes. This extension is ideal for developers who prefer to work with YAML for its readability but need to store data in JSON for processing or storage.
Features
- Seamless YAML to JSON Conversion: Edit
.nano
files in YAML format, and the extension will automatically convert and save them as JSON.
- Automatic Formatting: When opening
.nano
files, JSON is converted to YAML for easy editing.
- Customizable: Works with Visual Studio Code's built-in configuration to enhance your workflow.
Example:
Editing a .nano
file:
title: My App Config
settings:
- theme: dark
- autosave: true
The file is saved as:
{
"title": "My App Config",
"settings": [
{ "theme": "dark" },
{ "autosave": true }
]
}
Requirements
- Node.js must be installed on your machine.
- The extension uses the
js-yaml
library for the conversion between YAML and JSON. This will be automatically installed when you install the extension.
Installation
You can install the nano-vscode
extension via the Visual Studio Code Marketplace:
- Open VSCode and go to the Extensions view (
Ctrl+Shift+X
or Cmd+Shift+X
on macOS).
- Search for nano-vscode.
- Click Install.
Usage
- Open any
.nano
file in Visual Studio Code.
- The extension will automatically display the content in YAML format.
- When you save the file (
Ctrl+S
or Cmd+S
), the content will be saved in JSON format.
Extension Commands
Currently, there are no additional commands. The extension runs automatically when opening .nano
files.
Extension Settings
This extension contributes the following settings:
nano-vscode.formatOnSave
: Enable/disable automatic formatting when saving. Default is true
.
Known Issues
- Large YAML files may take longer to convert, depending on the system performance.
- If you encounter conversion errors (e.g., invalid YAML or JSON), an error message will be displayed, and the file will not be saved.
Release Notes
1.0.0
- Initial release of
nano-vscode
.
- Support for YAML to JSON conversion on save.
- Automatic YAML format display for
.nano
files.
1.1.0
- Improved performance for larger files.
- Added configuration options for format-on-save behavior.
If you want to learn more about working with extensions in Visual Studio Code, check out these resources:
Enjoy editing your .nano
files effortlessly with nano-vscode!