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

suf-cli

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

suf-cli - npm Package Compare versions

Comparing version 0.0.6 to 0.1.0

dist/badgeTypes.js

4

dist/badges.js

@@ -127,3 +127,3 @@ "use strict";

}
return out;
return out.replace(/^ /, '');
};

@@ -143,3 +143,3 @@ GenBadges.prototype.addBadge = function (_badge, CONFIG) {

var params = split[2];
var baseLink = ' https://img.shields.io';
var baseLink = 'https://img.shields.io';
switch (type) {

@@ -146,0 +146,0 @@ case 'install':

@@ -47,19 +47,20 @@ #!/usr/bin/env node

var license_1 = require("./license");
var logger_1 = require("./logger");
(function () { return __awaiter(void 0, void 0, void 0, function () {
var args, Package, config, STATE, _a, err_1;
var ARGS, Package, config, STATE, _a, err_1;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
args = utility_1.getArgs();
ARGS = utility_1.getArgs();
return [4 /*yield*/, utility_1.getPackageJson()];
case 1:
Package = _b.sent();
return [4 /*yield*/, config_1.getConfig(args, Package)];
return [4 /*yield*/, config_1.getConfig(Package)];
case 2:
config = _b.sent();
STATE = new state_1.State(Package, config, args);
STATE = new state_1.State(Package, config);
_b.label = 3;
case 3:
_b.trys.push([3, 14, , 15]);
_a = args[0];
_b.trys.push([3, 15, , 16]);
_a = ARGS[0] ? ARGS[0].replace(/^--?/, '') : ARGS[0];
switch (_a) {

@@ -76,29 +77,34 @@ case 'a': return [3 /*break*/, 4];

case 'license': return [3 /*break*/, 10];
case 'h': return [3 /*break*/, 12];
case 'help': return [3 /*break*/, 12];
}
return [3 /*break*/, 12];
return [3 /*break*/, 13];
case 4: return [4 /*yield*/, CallAll(STATE)];
case 5:
_b.sent();
return [3 /*break*/, 13];
return [3 /*break*/, 14];
case 6: return [4 /*yield*/, new badges_1.GenBadges(STATE).res()];
case 7:
_b.sent();
return [3 /*break*/, 13];
return [3 /*break*/, 14];
case 8: return [4 /*yield*/, new tsDoc_1.TsDoc(STATE).res()];
case 9:
_b.sent();
return [3 /*break*/, 13];
return [3 /*break*/, 14];
case 10: return [4 /*yield*/, new license_1.License(STATE).res()];
case 11:
_b.sent();
return [3 /*break*/, 13];
return [3 /*break*/, 14];
case 12:
logger_1.logger.Log('help');
return [3 /*break*/, 14];
case 13:
new default_1.Default(STATE);
return [3 /*break*/, 13];
case 13: return [3 /*break*/, 15];
case 14:
return [3 /*break*/, 14];
case 14: return [3 /*break*/, 16];
case 15:
err_1 = _b.sent();
console.error(err_1);
return [3 /*break*/, 15];
case 15: return [2 /*return*/];
return [3 /*break*/, 16];
case 16: return [2 /*return*/];
}

@@ -105,0 +111,0 @@ });

@@ -66,3 +66,3 @@ "use strict";

var CONFIG_PATH = './suf.config.json';
function getConfig(args, Package) {
function getConfig(Package) {
return __awaiter(this, void 0, void 0, function () {

@@ -78,3 +78,3 @@ var _this = this;

hasConfig = _e.sent();
if (!(!hasConfig || args[0] === '-fc')) return [3 /*break*/, 6];
if (!!hasConfig) return [3 /*break*/, 6];
logger_1.logger.Log('info', 'No config Found, do you want to create one? ', '[Y/n]');

@@ -128,5 +128,4 @@ return [4 /*yield*/, suf_node_1.getYNAnswer()];

case 2:
/**this function should only be called without the type parameter,
when there is no config. */
config = __assign({}, CONFIG);
/**this will only be executed when there is no config. */
config = {};
updateOrCreate = 'Create';

@@ -147,3 +146,3 @@ _c = [];

if (!_j.sent()) return [3 /*break*/, 6];
_e = [__assign({}, CONFIG)];
_e = [__assign({}, config)];
_h = {};

@@ -150,0 +149,0 @@ _f = key;

@@ -24,4 +24,4 @@ "use strict";

],
preset: new log_1.PresetNodeHelp("--out: OUTPUT_FILE:Relative path to the output file with extension.\n--dir: DIR: Relative path to the input dir.\n--name: NAME: Header name.\n--exclude: FILES: Comma separated list of files to exclude, cannot be used with --include\n--include: FILES: Comma separated list of files to include, cannot be used with --exclude\n-h: : Displays this Message.", ':', 11, 90)
preset: new log_1.PresetNodeHelp("INFO: All arguments can start with - or --, but i would recommend to just use letters.\na | all: Calls all modules.\nb | badges: Calls the badges module.\nt | ts | d.ts | docs: Calls the tsDoc module.\nl | licence: Calls the license module.\nh | help: Displays this Message.", ':', 25, 90)
}
});

@@ -42,6 +42,5 @@ "use strict";

var State = /** @class */ (function () {
function State(PACKAGE, _CONFIG, ARGS) {
function State(PACKAGE, _CONFIG) {
this.PACKAGE = PACKAGE;
this._CONFIG = _CONFIG;
this.ARGS = ARGS;
}

@@ -48,0 +47,0 @@ Object.defineProperty(State.prototype, "CONFIG", {

@@ -111,3 +111,3 @@ "use strict";

}
return [4 /*yield*/, fs_1.promises.writeFile(CONFIG.out, input.replace(utility_marker_1.insertionMarker.regex, utility_marker_1.getGenerated("# " + CONFIG.title + "\n" + this.createNav(navLinks) + rawText, 'tsDoc')))];
return [4 /*yield*/, fs_1.promises.writeFile(CONFIG.out, input.replace(utility_marker_1.insertionMarker.regex, utility_marker_1.getGenerated("\n# " + CONFIG.title + "\n" + this.createNav(navLinks) + rawText, 'tsDoc')))];
case 3:

@@ -114,0 +114,0 @@ _a.sent();

@@ -18,4 +18,4 @@ "use strict";

license: {
regex: /<span id="LICENSE_GENERATION_MARKER_0">[\S\s]*<\/span>/,
marker: '<span id="LICENSE_GENERATION_MARKER_0">\n__INSERT_GENERATED__\n</span>'
regex: /<span id="LICENSE_GENERATION_MARKER_0"><\/span>[\S\s]*<span id="LICENSE_GENERATION_MARKER_1"><\/span>/,
marker: '<span id="LICENSE_GENERATION_MARKER_0"></span>\n__INSERT_GENERATED__\n<span id="LICENSE_GENERATION_MARKER_1"></span>'
}

@@ -22,0 +22,0 @@ };

{
"name": "suf-cli",
"version": "0.0.6",
"version": "0.1.0",
"description": "Utility Cli",
"main": "./dist/cli.js",
"scripts": {
"prepack": "del ./dist && tsc -b && node ./dist/cli.js"
"prepack": "del ./dist && del ./types && tsc -b && node ./dist/cli.js"
},

@@ -23,3 +23,2 @@ "author": "Syler",

"@sorg/log": "^1.0.2",
"del-cli": "^3.0.0",
"node-fetch": "^2.6.0",

@@ -33,2 +32,3 @@ "suf-node": "^1.1.0",

"@types/node-fetch": "^2.5.4",
"del-cli": "^3.0.0",
"package-json-type": "^1.0.3",

@@ -35,0 +35,0 @@ "tslib": "^1.10.0"

## suf-cli
<span id="BADGE_GENERATION_MARKER_0"></span>
[![npmV]( https://img.shields.io/npm/v/suf-cli)](https://www.npmjs.com/package/suf-cli) [![min]( https://img.shields.io/bundlephobia/min/suf-cli)](https://bundlephobia.com/result?p=suf-cli) [![install](https://badgen.net/packagephobia/install/suf-cli)](https://packagephobia.now.sh/result?p=suf-cli) [![githubLastCommit]( https://img.shields.io/github/last-commit/TheRealSyler/suf-cli)](https://github.com/TheRealSyler/suf-cli)
[![npmV](https://img.shields.io/npm/v/suf-cli)](https://www.npmjs.com/package/suf-cli) [![min](https://img.shields.io/bundlephobia/min/suf-cli)](https://bundlephobia.com/result?p=suf-cli) [![install](https://badgen.net/packagephobia/install/suf-cli)](https://packagephobia.now.sh/result?p=suf-cli) [![githubLastCommit](https://img.shields.io/github/last-commit/TheRealSyler/suf-cli)](https://github.com/TheRealSyler/suf-cli)
<span id="BADGE_GENERATION_MARKER_1"></span>
suf-cli is a utility cli for automating readme stuff, like adding a license(also adds a license file).
suf-cli is a utility cli for automating readme stuff, like adding a license, most of the stuff below and above has been generated with this cli.
## TODO
## Usage
- add help command
- add readme
```bash
suf
```
<span id="LICENSE_GENERATION_MARKER_0">
this cli works by reading the `suf.config.json` file, every cli module has its section in the config file, if you call the cli without any arguments it will ask you to create a config or it executes all modules present in the config, to add a module just execute the command for that module.
> INFO: All arguments can start with - or --, but i would recommend to just use letters.
| Command | |
| ------------------------------- | ------------------------- |
| `a` \| `all` | Calls all modules. |
| `b` \| `badges` | Calls the badges module. |
| `t` \| `ts` \| `d.ts` \| `docs` | Calls the tsDoc module. |
| `l` \| `licence` | Calls the license module. |
| `h` \| `help` | Displays this Message. |
<span id="DOC_GENERATION_MARKER_0"></span>
# Docs
- **[Modules](#modules)**
- [BadgesModuleConfig](#badgesmoduleconfig)
- [TsDocModuleConfig](#tsdocmoduleconfig)
- [LicenseModuleConfig](#licensemoduleconfig)
- [ConfigFile](#configfile)
- **[badgeTypes](#badgetypes)**
- [Badges](#badges)
- [Links](#links)
### Modules
##### BadgesModuleConfig
```typescript
interface BadgesModuleConfig {
/**package name */
name: string;
/**github username */
github: string;
/**vscode publisher.packageName */
vscode?: string;
/**github repo name */
repo: string;
/**path to readme or other target file */
out: string;
/**Array of badges */
badges: string[];
/**link to external config,(not sure if this still works) */
externalConfig?: string;
}
```
##### TsDocModuleConfig
```typescript
interface TsDocModuleConfig {
/**title displayed at the top of the generated text */
title: string;
/**path to the d.ts files */
dir: string;
/**path to readme or other target file */
out: string;
/**include all files in array, include and exclude cannot be used at the same time */
include?: string[];
/**exclude all files in array, include and exclude cannot be used at the same time */
exclude?: string[];
}
```
##### LicenseModuleConfig
```typescript
interface LicenseModuleConfig {
/**license type */
type: string;
/**license year */
year: string;
/**full name of the copyright holder */
name: string;
/**path to readme or other target file */
out: string;
/**path/name of the LICENSE file */
file: string;
}
```
##### ConfigFile
```typescript
interface ConfigFile {
badges?: BadgesModuleConfig;
tsDoc?: TsDocModuleConfig;
license?: LicenseModuleConfig;
}
```
### badgeTypes
##### Badges
```typescript
interface Badges {
/** circleCi build. */
circleci: '/circleci/build/github/<GITHUB>/<REPO>';
/** Vscode Extension Version. */
vscV: '/visual-studio-marketplace/v/<VSCODE>';
/** Vscode Extension downloads. */
vscD: '/visual-studio-marketplace/d/<VSCODE>';
/** Vscode Extension installs. */
vscI: '/visual-studio-marketplace/i/<VSCODE>';
/** Vscode Extension ratings. */
vscR: '/visual-studio-marketplace/r/<VSCODE>';
/** Bundlephobia Min. */
min: '/bundlephobia/min/<NAME>';
/** Bundlephobia Minzip. */
minzip: '/bundlephobia/minzip/<NAME>';
/** Packagephobia Install. */
install: '/packagephobia/install/<NAME>';
/** Packagephobia Publish. */
publish: '/packagephobia/publish/<NAME>';
/** Npm Version. */
npmV: '/npm/v/<NAME>';
/** Npm Weekly Downloads. */
npmDW: '/npm/dw/<NAME>';
/** Npm Monthly Downloads. */
npmDM: '/npm/dm/<NAME>';
/** Npm Yearly Downloads. */
npmDY: '/npm/dy/<NAME>';
/** Npm Total Downloads. */
npmDT: '/npm/dt/<NAME>';
/** Npm Types. */
npmTypes: '/npm/types/<NAME>';
/** Npm License. */
npmLicense: '/npm/license/<NAME>';
/** Npm Node. */
npmNode: '/npm/node/<NAME>';
/** Npm Dependents. */
npmDep: '/npm/dependents/<NAME>';
/** GitHub Followers. */
githubFollowers: '/github/followers/<GITHUB>';
/** GitHub Forks. */
githubForks: '/github/forks/<GITHUB>/<REPO>';
/** GitHub Starts. */
githubStars: '/github/stars/<GITHUB>/<REPO>';
/** GitHub Issues. */
githubIssues: '/github/issues/<GITHUB>/<REPO>';
/** GitHub Last Commit. */
githubLastCommit: '/github/last-commit/<GITHUB>/<REPO>';
/** Custom, usage example: badge=https://img.shields.io/badge/custom%2C-Badge-brightgreen. */
badge: '<CUSTOM>';
}
```
##### Links
```typescript
interface Links {
/** Npm package. */
npm: 'https://www.npmjs.com/package/<NAME>';
/** Github Repo. */
github: 'https://github.com/<GITHUB>/<REPO>';
/** circleCi Repo Pipelines. */
circleci: 'https://app.circleci.com/github/<GITHUB>/<REPO>/pipelines';
/** Visual Studio marketplace. */
vscode: 'https://marketplace.visualstudio.com/items?itemName=<VSCODE>';
/** Bundlephobia Link. */
bundle: 'https://bundlephobia.com/result?p=<NAME>';
/** Packagephobia Link. */
package: 'https://packagephobia.now.sh/result?p=<NAME>';
/** Custom, usage example: link=https://example.com. */
link: '<CUSTOM>';
}
```
_Generated with_ **[suf-cli](https://www.npmjs.com/package/suf-cli)**
<span id="DOC_GENERATION_MARKER_1"></span>
<span id="LICENSE_GENERATION_MARKER_0"></span>
Copyright (c) 2019 Leonard Grosoli Licensed under the MIT license.
</span>
<span id="LICENSE_GENERATION_MARKER_1"></span>
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