Socket
Socket
Sign inDemoInstall

writr

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

writr - npm Package Compare versions

Comparing version 0.8.2 to 0.8.3

dist/cache.d.ts

4

dist/data/dataService.d.ts

@@ -5,6 +5,6 @@ import { Config } from "../config";

import { DataProviderInterface } from "./dataProviderInterface";
import { DataCacheService } from "./dataCacheService";
import { Cache } from "../cache";
export declare class DataService {
config: Config;
cache: DataCacheService;
cache: Cache;
constructor(config: Config);

@@ -11,0 +11,0 @@ getPost(id: string): Promise<Post | undefined>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fileDataProvider_1 = require("./fileDataProvider");
const dataCacheService_1 = require("./dataCacheService");
const cache_1 = require("../cache");
class DataService {
constructor(config) {
this.config = config;
this.cache = new dataCacheService_1.DataCacheService(this.config);
this.cache = new cache_1.Cache(this.config);
}

@@ -10,0 +10,0 @@ //posts

@@ -100,4 +100,5 @@ "use strict";

async parsePost(filePath) {
let result = new post_1.Post();
let result = undefined;
if (await fs.pathExists(filePath)) {
result = new post_1.Post();
let buff = await fs.readFile(filePath);

@@ -104,0 +105,0 @@ let data = buff.toString();

@@ -7,3 +7,3 @@ /// <reference types="node" />

config: Config | undefined;
dataStore: DataService | undefined;
data: DataService | undefined;
constructor();

@@ -10,0 +10,0 @@ parseCLI(process: NodeJS.Process): void;

@@ -6,8 +6,8 @@ "use strict";

const config_1 = require("./config");
const htmlProvider_1 = require("./render/htmlProvider");
const htmRenderlProvider_1 = require("./render/htmRenderlProvider");
const del = require("del");
const fs = require("fs-extra");
const jsonProvider_1 = require("./render/jsonProvider");
const atomProvider_1 = require("./render/atomProvider");
const imageProvider_1 = require("./render/imageProvider");
const jsonRenderProvider_1 = require("./render/jsonRenderProvider");
const atomRenderProvider_1 = require("./render/atomRenderProvider");
const imageRenderProvider_1 = require("./render/imageRenderProvider");
class Writr {

@@ -32,7 +32,7 @@ constructor() {

this.config.loadProgram(program);
this.dataStore = new dataService_1.DataService(this.config);
this.data = new dataService_1.DataService(this.config);
}
async runCLI() {
let result = true;
if (this.dataStore !== undefined && this.config !== undefined) {
if (this.data !== undefined && this.config !== undefined) {
if (fs.existsSync(this.config.output)) {

@@ -45,12 +45,12 @@ del.sync(this.config.output);

if (type === "html") {
render = await new htmlProvider_1.HtmlProvider().render(this.dataStore, this.config);
render = await new htmRenderlProvider_1.HtmlRenderProvider().render(this.data, this.config);
}
if (type === "json") {
render = await new jsonProvider_1.JSONProvider().render(this.dataStore, this.config);
render = await new jsonRenderProvider_1.JSONRenderProvider().render(this.data, this.config);
}
if (type === "atom") {
render = await new atomProvider_1.AtomProvider().render(this.dataStore, this.config);
render = await new atomRenderProvider_1.AtomRenderProvider().render(this.data, this.config);
}
if (type === "images") {
render = await new imageProvider_1.ImageProvider().render(this.dataStore, this.config);
render = await new imageRenderProvider_1.ImageRenderProvider().render(this.data, this.config);
}

@@ -57,0 +57,0 @@ }

@@ -16,5 +16,2 @@ export declare class Post {

matter: any;
metaData: {
[key: string]: any;
};
readonly body: any;

@@ -21,0 +18,0 @@ published: boolean;

@@ -50,8 +50,2 @@ "use strict";

}
get metaData() {
return this._matter;
}
set metaData(val) {
this._matter = val;
}
get body() {

@@ -58,0 +52,0 @@ if (!this.matter.body) {

import { DataService } from "../data/dataService";
import { Config } from "../config";
export interface RenderProviderInterface {
render(dataStore: DataService, config: Config): Promise<Boolean | undefined>;
render(data: DataService, config: Config): Promise<Boolean | undefined>;
}
{
"name": "writr",
"version": "0.8.2",
"version": "0.8.3",
"description": "A Simple to Use Markdown Blog",

@@ -47,3 +47,3 @@ "main": "./dist/index",

"gray-matter": "^4.0.2",
"handlebars": "^4.0.11",
"handlebars": "~>4.3.0",
"helper-date": "^1.0.1",

@@ -50,0 +50,0 @@ "keyv": "^3.0.0",

@@ -141,3 +141,3 @@ ![Writr](logo.png)

### Set it in the Post
#### Set Layout it in the Post

@@ -160,3 +160,3 @@ ```yaml

### Set it Globally
#### Set Layout Globally

@@ -163,0 +163,0 @@ To set it globally you can set it in the `config.json` by setting the `permaLink` variable like so:

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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