Skip to content
Fix Code Error

How to reformat JSON in Notepad++?

March 13, 2021 by Code Error
Posted By: Anonymous

I need Notepad++ to take a json string from this

{"menu": {"id": "file","value": "File","popup": {"menuitem": [{"value": "New", "onclick": "CreateNewDoc()"},{"value": "Open", "onclick": "OpenDoc()"},{"value": "Close", "onclick": "CloseDoc()"}]}}}

to this…

{"menu": {
  "id": "file",
  "value": "File",
  "popup": {
    "menuitem": [
      {"value": "New", "onclick": "CreateNewDoc()"},
      {"value": "Open", "onclick": "OpenDoc()"},
      {"value": "Close", "onclick": "CloseDoc()"}
    ]
  }
}}

I looked around at all the TextFX options but couldn’t find anything that worked.

Solution

Update:

As of Notepad++ v7.6, use Plugin Admin to install JSTool per this answer

INSTALL

Download it from http://sourceforge.net/projects/jsminnpp/ and copy JSMinNpp.dll to plugin directory of Notepad++. Or you can just install “JSTool” from Plugin Manager in Notepad++.

New Notepad++ install and where did PluginManager go? See How to view Plugin Manager in Notepad++

{
  "menu" : {
    "id" : "file",
    "value" : "File",
    "popup" : {
      "menuitem" : [{
      "value" : "New",
          "onclick" : "CreateNewDoc()"
        }, {
          "value" : "Open",
          "onclick" : "OpenDoc()"
        }, {
          "value" : "Close",
          "onclick" : "CloseDoc()"
        }
      ]
    }
  }
}

enter image description here
Tip: Select the code you want to reformat, then Plugins | JSTool | JSFormat.

Answered By: Anonymous

Related Articles

  • error LNK2005: ✘✘✘ already defined in…
  • WPF MenuItem MouseOver does not change the background color
  • What is the worst programming language you ever worked with?
  • Vuejs route redirect on refresh
  • Detect if Visual C++ Redistributable for Visual…
  • How do I install soap extension?
  • Error Message : Cannot find or open the PDB file
  • How to avoid a System.Runtime.InteropServices.COMException?
  • Removing duplicate rows in Notepad++
  • Problems Installing CRA & NextJS from NPM…
  • React Multi-level push menu SCSS Back button not working
  • How can I specify a [DllImport] path at runtime?
  • Apache server keeps crashing, "caught SIGTERM,…
  • multiple login routes using ember-cli-simple-auth
  • Compile a DLL in C/C++, then call it from another program
  • Error: Can't set headers after they are sent to the client
  • How to download Xcode DMG or XIP file?
  • Polymer 2.0 nested iron-pages
  • TextFX menu is missing in Notepad++
  • The 'compilation' argument must be an instance of…
  • How to change MenuItem icon in ActionBar programmatically
  • Material-UI FormControl InputLabel display problem
  • How to change Windows 10 interface language on…
  • Can we customize WPF MenuItem style on IsPressed
  • Form field border-radius is not working only on the…
  • The POM for project is missing, no dependency…
  • What are the new features in C++17?
  • How to download images without displaying them using Vue.js?
  • Backbone.js hover event not triggering
  • How do I control c++ DLL debug symbols loading?
  • How to Fix Aurelia Router failing on refresh of child route?
  • How do I automatically adopt the MenuItemIcon as a…
  • How can I setup Firebase hosting multisites with Nextjs
  • Android custom dropdown/popup menu
  • I use useState hock to store the value but it did not update
  • How to override and extend basic Django admin templates?
  • How to check for a logged in admin in polymerfire?
  • Django admin/ return 404
  • SVN "Already Locked Error"
  • How to view Plugin Manager in Notepad++
  • How to format JSON in notepad++
  • How to use Next.js Link (next/link) component in a…
  • Download & Install Xcode version without Premium…
  • How to extract an assembly from the GAC?
  • MSBuild doesn't copy references (DLL files) if using…
  • Could not load file or assembly 'Newtonsoft.Json' or…
  • Import javascript file after component is mounted
  • Having trouble with my nav bar/header, It used to…
  • Error message "Forbidden You don't have permission…
  • Download a file with Android, and showing the…
  • Intellij "reformat code" command doesn't follow…
  • What is the copy-and-swap idiom?
  • How to add Css Class to item inside Ember's…
  • How do I install Java on Mac OSX allowing version switching?
  • MongoDB - admin user not authorized
  • Delay content of test of Cloud Functions with Mocha
  • How to blur the background after click on the button…
  • Cannot read property '$i18n' of undefined when using…
  • .Net picking wrong referenced assembly version
  • Find CRLF in Notepad++
  • Polymer 1.0 Trying to make a splitter which works…
  • Could not calculate build plan: Plugin…
  • How can I find the product GUID of an installed MSI setup?
  • how to install gcc on windows 7 machine?
  • Scrollable Menu with Bootstrap - Menu expanding its…
  • How do I automatically adopt the MenuItemIcon as a…
  • Aurelia bundling issue with virtual directory
  • Loading DLLs at runtime in C#
  • How to Call Method Only if LIbrary Exists
  • What exactly are DLL files, and how do they work?
  • Switch class on tabs with React.js
  • No viable conversion from '__wrap_iter' to '__wrap_iter'
  • How to dynamically create React elements…
  • How to download and save an image in Android
  • Polymer - Show empty state on nested dom-repeat with filter
  • Navigation drawer: How do I set the selected item at…
  • How to make onClick card to move to another page in react
  • Specifying java version in maven - differences…
  • Visual Studio debugging/loading very slow
  • How do I build an import library (.lib) AND a DLL in…
  • Calling a component function outside of the component
  • Qt 5.1.1: Application failed to start because…
  • Register DLL file on Windows Server 2008 R2
  • Material-UI button requires 3 clicks before it will…
  • D3 chart integration into Vuejs
  • Vue.js - Element UI - Nested dialog won't open from…
  • How to change the appearance of an OpenLayers marker…
  • How to pass a function with arguments via JavaScript…
  • Add Allauth login_required decorator to…
  • Downloading Java JDK on Linux via wget is shown…
  • Smart way to truncate long strings
  • Why am I getting a "401 Unauthorized" error in Maven?
  • Mongo client set in main function, functions in…
  • How to fix "Referenced assembly does not have a…
  • Best way to replace multiple characters in a string?
  • How to filter a RecyclerView with a SearchView
  • Why so much unused space, engine is skipping to a…
  • Could not find module "@angular-devkit/build-angular"
  • Can I hide/show asp:Menu items based on role?
  • Best practice for Django project working directory structure

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

How can I get form data with JavaScript/jQuery?

Next Post:

How to set the authorization header using curl

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error