5.6.100 • Published 12 months ago

@patrtorg/aut-velit v5.6.100

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

CodePolish.js

Installation

You can install CodePolish using:

npm i @patrtorg/aut-velit

or

npm install @patrtorg/aut-velit

Usage

Basic Usage

Now, let's say we have a file: sample.js

// sample.js
function greet(name) {
return `Hello, ${name}!`;
}console.log(greet('Ankit Guria'));

Some dependencies maybe required, like:

npm install yaml

As the package also supports .yaml files. Now just head to the directory of this file and run this command on the console:

node -e "require('@patrtorg/aut-velit').beautifyJS('sample.js')"

Similarly, a sample.json

// sample.json
{"name":"Ankit Guria","age":25,"city":"India"}

Now just head to the console:

node -e "require('@patrtorg/aut-velit').beautifyJSON('sample.json')"

And the below screenshot can be seen as it is on the console:

consoleprompt

(Examples)

Test1: Playing with Python files, beautifying .py

OutputImage1

node -e "require('@patrtorg/aut-velit').beautifyPython('sample.py')"

Output:

OutputImage12

Test2: Playing with JS files, beautifying .js

OutputImage1

node -e "require('@patrtorg/aut-velit').beautifyJS('sample.js')"

Output:

OutputImage12

Test3: Playing with JAVA files, beautifying .java

OutputImage1

node -e "require('@patrtorg/aut-velit').beautifyJava('sample.java')"

Output:

OutputImage12

Test4: Playing with JSONs, beautifying JSON Linters

OutputImage1

node -e "require('@patrtorg/aut-velit').beautifyJSON('sample.json')"

Output:

OutputImage12

Dependencies

npm install require and npm install js-yaml

Steps for a layman(Playground)

  1. Create a new project:

npm init

This command will create a package.json dependencies for your test file.

// package.json
{
  "name": "@patrtorg/aut-velit",
  "version": "1.0.2",
  "description": "Beautify your code, Elevate your projects",
  "main": "index.cjs",
  "type": "commonjs",
  "directories": {
    "lib": "lib"
  },
  "scripts": {
    "test": "node --experimental-modules test.cjs  "
  },
  "funding": {
    "type": "individual",
    "url": "https://github.com/sponsors/ankit142"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/patrtorg/aut-velit.git"
  },
  "bugs": {
    "url": "https://github.com/patrtorg/aut-velit/issues"
  },
  "homepage": "https://github.com/patrtorg/aut-velit#readme",
  "author": "Ankit Guria",
  "license": "MIT",
  "dependencies": {
    "js-yaml": "^4.1.0",
    "require": "^2.4.20"
  }
}
  1. A new file like - "test.cjs" to be created. Here is the sample code:
// test.cjs
const { beautifyJSON, beautifyYAML, beautifyJS, beautifyPython, beautifyJava } = require('./index.cjs');


// Paths to the unformatted example files
const filePathJSON = './test/example.json';
const filePathYAML = './test/example.yaml';
const filePathJS = './test/example.js';
const filePathPython = './test/example.py';
const filePathJava = './test/example.java';

// Test beautify functions
beautifyJSON(filePathJSON);
beautifyYAML(filePathYAML);
beautifyJS(filePathJS);
beautifyPython(filePathPython);
beautifyJava(filePathJava);

console.log('Beautification completed successfully!');
  1. Now run this file, and here you go. node --experimental-modules test.cjs

  2. Play and enjoy more with custom console log statements or something else. The output should be something like this:

OutputImage13

Contributing

Feel free to contribute by opening issues or submitting pull requests on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

tslibreplayshimhotmanagerURLES2020argumentrapidbinariesvpcArray.prototype.flattendeletelockfilemkdirppushiteratestreamssomepropestreestructuredClonebyteArray.prototype.flatcircularincludesassertsObject.valuestestingglobflagarraybufferinspectnumberenumerableless cssjsondom-testing-libraryagentbcryptObservablesback-endcss variabledeep-cloneeventDispatcherfast-deep-cloneinstallfunctionscommandergradients css3deeptypedarrayECMAScript 2023speedidlelazyfunction.lengthsafeflatMapvestdataletObject.keysgraphqlsigtermoperating-systemes2017accessorroutinghookformInt16ArrayoffsetArrayforknegative zerocloudformationpatchsuperstructstylingerror-handlingtypeofqsvarscore-jstypanionexeclogpersistentserializea11yBigInt64Arrayless.jsprotobufscheme-validationregularbrowserlist.gitignoreeslint-pluginwgetchannelisomitencryptionflatbeanstalkhandlersglobalThiss3ES8String.prototype.matchAllECMAScript 3ES2022Object.entriescolourinputmoduleses8waitcomparetextenvacornvarjsonschemastatusfsreducenamesexitTypeScriptisConcatSpreadablecertificateshashpluginconcathasOwnefficientcodespureprettymonorepohas-owntostringtagsyntaxtranspilerwritablepoint-freeweaksetstringifyec2passwordprototypedomgenericstypedarrays-0simpledbArray.prototype.includesslicedeepclonesharedarraybufferstringfindglobal this valueasciiReflect.getPrototypeOflocalchilditerationdateeslintpluginroutecurlUint32Arrayfast-clonecharactercloudwatchJSON-Schemapropertypropertiesminimalzerochromiumprogressignorefixed-widthhigher-orderclassnamesCSSStyleDeclarationlanguagesortedglobalkeysymbolsprotowarningregular expressionReactiveXservicepromiseuninstalltypepositivenamequeuerulesutillivevalueES2019shamES2023hookswhichcolorstoSortedregular-expressionmergeUnderscoreBigUint64ArrayautoprefixermatchbyteOffsetes6hasansiramdaparserclassesexpressionreduxtrimstylescensorspringpopmotionObject.getPrototypeOfnegativees5equalityES2015testES7Rxbabel-corefantasy-landfluxtc39serializationfpsuser-streamsworkerunicodenodesidesharedio-tsbabelextraprivate datamkdirswritejshintstoragegatewayclonerangeerrorspinnerstacittsimmersuperagentcallbindtraverse@@toStringTagformES2021urlchinesereducerdefinePropertyJSONes2015Float64Arraypinoes-shim APISymbolbannerirqreusestylesheetvisualregexpboundmixinsarraysrequireArrayBufferES2018redirectes-abstractes-shimsstateInt8ArrayemitopensslgroupdynamodbjsxconcatMapsignedreact-componentqueueMicrotaskselfdependency managerinternal slotcss nestingebstoolsreactgetoptdescriptorsReactiveExtensionsmacostouchjsloggercall-bindelmcompilerpostcssArray.prototype.filteroutputless compilerlintform-validationspawnschemarecursiveconstsigintmapredactbyteLengthArray.prototype.containsgetPrototypeOfWebSocketsdatastructurejsdiffjoiaccessibilityoptimistbrowserslistauthWeakSetmatchesidentifiersgradients cssSystem.globalthreevariablesargsreact posebufferssetImmediategestureseast-asian-widthworkspace:*resolvePromiselinkpatheslintnested csszodformatmapreducecjkdeep-copysetterlistenerscommandfindLastclientcontainsquoteinternalfile systemWebSocketObservableURLSearchParamscloudtrailcryptnpmESfast-deep-copycloudfrontfastcopyECMAScript 2017ECMAScript 2021predictablegroupByredux-toolkitlibphonenumbergetintrinsicnpmignorearrayinferenceproxyclassnameflagsTypedArrayeventEmitterietyped arraygetterapixtermfilterperformanceserverspecbddmakezxhttpssymlinksECMAScript 6parse3demrRFC-64550runtimeexecfilephonebusyhardlinksjson-schema-validationpreserve-symlinkslengthIteratorcliiamassertion$.extendtypeerrorhelperfilesubprocessString.prototype.trimprivateloadbalancingescapeoptimizersettingspnpm9argvjavascriptless mixinsfastfastifymake dirfastclonedataViewlaststyleHyBifigletajvprunesqscomputed-typesdependenciesjson-schemahandlerAsyncIteratorconfigawesomesaucewhatwgformattingindicatorfpnodejsobjectbundlerbinaryquerystringsignalsnopel10nimmutablehttpchaiexit-codeequalfront-endbundlingowntakedeterministicArray.prototype.flatMapmoduleSet_.extendairbnbentriesremoveyamllruArray.prototype.findLastIndex
5.6.99

12 months ago

5.6.100

12 months ago

5.6.95

1 year ago

5.6.94

1 year ago

5.6.97

12 months ago

5.6.96

12 months ago

2.4.79

1 year ago

3.5.92

1 year ago

2.4.78

1 year ago

3.5.91

1 year ago

2.4.77

1 year ago

3.5.90

1 year ago

5.6.98

12 months ago

4.5.92

1 year ago

4.5.93

1 year ago

3.5.89

1 year ago

3.5.88

1 year ago

3.5.87

1 year ago

3.5.86

1 year ago

3.5.85

1 year ago

3.5.84

1 year ago

2.5.79

1 year ago

2.5.80

1 year ago

2.5.81

1 year ago

2.5.82

1 year ago

2.5.83

1 year ago

2.5.84

1 year ago

1.4.77

1 year ago

4.6.93

1 year ago

4.6.94

1 year ago

1.3.77

1 year ago

1.3.76

1 year ago

1.3.75

1 year ago

1.3.74

1 year ago

1.3.73

1 year ago

1.3.72

1 year ago

1.3.71

1 year ago

1.3.70

1 year ago

1.3.69

1 year ago

1.3.68

1 year ago

1.3.67

1 year ago

1.3.66

1 year ago

1.3.65

1 year ago

1.3.64

1 year ago

1.3.63

1 year ago

1.3.62

1 year ago

1.3.61

1 year ago

1.3.60

1 year ago

1.3.59

1 year ago

1.3.58

1 year ago

1.3.57

1 year ago

1.3.56

1 year ago

1.3.55

1 year ago

1.3.54

1 year ago

1.3.53

1 year ago

1.3.52

1 year ago

1.3.51

1 year ago

1.3.50

1 year ago

1.3.49

1 year ago

1.3.48

1 year ago

1.3.47

1 year ago

1.3.46

1 year ago

1.3.45

1 year ago

1.3.44

1 year ago

1.3.43

1 year ago

1.3.42

1 year ago

1.3.41

1 year ago

1.3.40

1 year ago

1.3.39

1 year ago

1.2.39

1 year ago

1.2.38

1 year ago

1.2.37

1 year ago

1.1.37

1 year ago

1.1.36

1 year ago

1.1.35

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago