Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jason-formatter

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jason-formatter - npm Package Compare versions

Comparing version 1.4.2 to 2.0.0

esm/mod.js

66

package.json
{
"module": "./esm/mod.js",
"main": "./script/mod.js",
"types": "./types/mod.d.ts",
"name": "jason-formatter",
"version": "1.4.2",
"description": "A Command Line tool to format JSON",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/UltiRequiem/json-formatter.git"
"description": "Shell utility and Library for formatting JSON files",
"version": "2.0.0",
"license": "MIT",
"funding": {
"type": "patreon",
"url": "https://www.patreon.com/ultirequiem"
},
"scripts": {
"format": "npx prettier --write '**/*.js'",
"lint": "npx eslint . --ext .js"
"repository": "github:ultirequiem/jason-formatter",
"homepage": "https://jason.js.org",
"bugs": {
"url": "https://github.com/ultirequiem/jason-formatter/issues",
"email": "eliaz.bobadilladev@gmail.com"
},
"bin": {
"jason": "./lib/cli/bin.js"
},
"keywords": [
"json",
"formatter",
"format",
"cli",
"terminal"
"cli"
],
"author": "Eliaz Bobadilla <eliaz.bobadilladev@gmail.com> (https://github.com/UltiRequiem)",
"license": "MIT",
"bugs": {
"url": "https://github.com/UltiRequiem/json-formatter/issues"
"exports": {
".": {
"import": "./esm/mod.js",
"require": "./script/mod.js",
"types": "./types/mod.d.ts"
}
},
"homepage": "https://github.com/UltiRequiem/json-formatter#readme",
"scripts": {
"test": "node test_runner.js"
},
"dependencies": {},
"devDependencies": {
"@types/colors": "^1.2.1",
"@types/node": "^16.9.1",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"eslint": "^7.31.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-prettier": "^3.4.0",
"prettier": "^2.3.2",
"prettier-eslint": "^12.0.0",
"typescript": "^4.4.3"
},
"dependencies": {
"colors": "^1.4.0"
"@types/node": "16.11.26",
"chalk": "4.1.2",
"@deno/shim-deno": "~0.4.3"
}
}
}

@@ -1,31 +0,25 @@

# Jason
# REWRITING ON PROGRESS
[![GitMoji](https://img.shields.io/badge/Gitmoji-%F0%9F%8E%A8%20-FFDD67.svg)](https://gitmoji.dev)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
![Lines Of Code](https://img.shields.io/tokei/lines/github.com/UltiRequiem/jason-formatter?color=blue&label=Total%20Lines)
![CodeQL](https://github.com/UltiRequiem/jason-formatter/workflows/CodeQL/badge.svg)
![Eslint](https://github.com/UltiRequiem/jason-formatter/workflows/Eslint/badge.svg)
# Jason Formatter
A simple [json](https://json.org) formmater.
A simple [json](https://json.org) formatter.
![Cover](./assets/cover.png)
## CLI
## Installation
### Install
To be able to use it in your entire system you have to install globally:
- [Deno](https://deno.land)
```bash
npm i -g jason
```sh
deno install --allow-read --allow-write https://deno.land/x/jason_formatter/jason.ts
```
If you use yarn:
- [Node.js](https://nodejs.org)
```bash
yarn global add jason
```sh
npm install --global jason-formatter
```
## Usage
### Usage
Now you can use it anywhere on your system:
```bash

@@ -35,42 +29,66 @@ jason config.json

By default, 2 tabs are used, but you can also specify how many tabs you want:
By default, 2 tabs are used, but you can also specify how many tabs you want 👇
```bash
jason config.json 4
jason config.json --tabs 4 # same as -t 4
```
Jason is also a library, so you can also import it in your code.
## Usage
Example using CommonJS:
### [Deno 🚀](https://deno.land/x/stable_fn)
```javascript
const jason = require('jason-formatter').default
```typescript
import { jason } from "https://deno.land/x/jason_formatter/mod.ts";
const rawData = `
{
const data = `{"nick":9}`;
"hey":9 ,
"jason":true
}
jason(data); /* {
"nick": 9
}*/
```
`
### [Node.js 🐢](https://www.npmjs.com/package/jason-formatter)
console.log(jason(rawData, { tabs: 2 }))
```ts
import { jason } from "jason-formatter";
```
Examples using ES6 or Typescript:
### Browser
```javascript
import jason from 'jason-formatter'
Using
[type module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)
🍱
const rawData = `
{
- [esm.sh](https://esm.sh/jason-formatter)
"hey":9 ,
"jason":true
}
- [skypack](https://cdn.skypack.dev/@ultirequiem/jason-formatter)
`
Using a plain
[script tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) 👇
console.log(jason(rawData, { tabs: 2 }))
```
- [jsdelivr](https://cdn.jsdelivr.net/npm/jason-formatter)
- [unpkg](https://unpkg.com/jason-formatter)
You have the same API on all of this platforms.
## Documentation
[Autogenerated Documentation](https://doc.deno.land/https://deno.land/x/stable_fn/mod.ts)
😎
## Support
Open an Issue, I will check it a soon as possible 👀
If you want to hurry me up a bit
[send me a tweet](https://twitter.com/intent/tweet?text=%40UltiRequiem%20) 😆
Consider [supporting me on Patreon](https://patreon.com/UltiRequiem) if you like
my work 🚀
Don't forget to start the repo ⭐
## Licence
Licensed under the MIT License.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc