This commit is contained in:
Tutur33
2023-11-24 23:58:26 +01:00
parent 25395c0ee1
commit 938ad9d309
4191 changed files with 41 additions and 518781 deletions
-9
View File
@@ -1,9 +0,0 @@
# The MIT License
Copyright 2022 Harminder Virk, contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-78
View File
@@ -1,78 +0,0 @@
<div align="center"><img src="https://res.cloudinary.com/adonis-js/image/upload/v1620150474/edge-banner_tzmnox.jpg" width="600px"></div>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of contents
- [Table of contents](#table-of-contents)
- [Maintainers](#maintainers)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
# Edge
> A template for Node.js
[![gh-workflow-image]][gh-workflow-url] [![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url] [![synk-image]][synk-url]
Edge is a logical and batteries included template engine for Node.js. It can render any text based format, whether is **HTML**, **Markdown** or **plain text** files.
## Usage
Install the package from the npm registry.
```sh
npm i edge.js
# yarn
yarn add edge.js
```
And use it as follows
```js
const { join } = require('path')
// CommonJS
const { Edge } = require('edge.js')
// Typescript import
// import { Edge } from 'edge.js'
const edge = new Edge({ cache: false })
edge.mount(join(__dirname, 'views'))
const html = await edge.render('welcome', {
greeting: 'Hello world'
})
console.log(html)
```
Next create the `views/welcome.edge` file.
```edge
<p> {{ greeting }} </p>
```
Edge was created to be used inside the AdonisJS framework. However it is a framework agnostic library and can be used standalone as well.
The documentation is written on the [AdonisJS website](https://docs.adonisjs.com/guides/views/rendering). In AdonisJS docs, we refer the `edge` variable as `view`.
<br />
<hr>
![](https://cdn.jsdelivr.net/gh/thetutlage/static/sponsorkit/sponsors.png)
[gh-workflow-image]: https://img.shields.io/github/actions/workflow/status/edge-js/edge/test.yml?style=for-the-badge
[gh-workflow-url]: https://github.com/edge-js/edge/actions/workflows/test.yml "Github action"
[typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
[typescript-url]: "typescript"
[license-image]: https://img.shields.io/npm/l/edge.js?color=blueviolet&style=for-the-badge
[license-url]: LICENSE.md 'license'
[npm-image]: https://img.shields.io/npm/v/edge.js.svg?style=for-the-badge&logo=npm
[npm-url]: https://npmjs.org/package/edge.js 'npm'
[synk-image]: https://img.shields.io/snyk/vulnerabilities/github/edge-js/edge?label=Synk%20Vulnerabilities&style=for-the-badge
[synk-url]: https://snyk.io/test/github/edge-js/edge?targetFile=package.json "synk"
-150
View File
@@ -1,150 +0,0 @@
{
"name": "edge.js",
"version": "5.5.1",
"description": "Template engine",
"main": "build/index.js",
"files": [
"build/src",
"build/index.d.ts",
"build/index.js"
],
"scripts": {
"pretest": "npm run lint",
"test": "node -r @adonisjs/require-ts/build/register ./bin/test.ts",
"mrm": "mrm --preset=@adonisjs/mrm-preset",
"commit": "git-cz",
"clean": "del-cli build",
"compile": "npm run lint && npm run clean && tsc",
"build": "npm run compile",
"lint": "eslint . --ext=.ts",
"release": "np --message=\"chore(release): %s\"",
"version": "npm run build",
"format": "prettier --write .",
"sync-labels": "github-label-sync --labels ./node_modules/@adonisjs/mrm-preset/gh-labels.json edge-js/edge",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/poppinss/edge.git"
},
"author": "virk",
"license": "MIT",
"bugs": {
"url": "https://github.com/poppinss/edge/issues"
},
"homepage": "https://github.com/poppinss/edge#readme",
"devDependencies": {
"@adonisjs/mrm-preset": "^5.0.3",
"@adonisjs/require-ts": "^2.0.12",
"@japa/assert": "^1.3.4",
"@japa/run-failed-tests": "^1.0.7",
"@japa/runner": "^2.0.9",
"@japa/spec-reporter": "^1.1.12",
"@poppinss/dev-utils": "^2.0.3",
"@types/node": "^18.7.14",
"chai": "^4.3.6",
"commitizen": "^4.2.5",
"cz-conventional-changelog": "^3.3.0",
"dedent-js": "^1.0.1",
"del-cli": "^5.0.0",
"doctoc": "^2.2.0",
"eslint": "^8.23.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-adonis": "^2.1.0",
"eslint-plugin-prettier": "^4.2.1",
"github-label-sync": "^2.2.0",
"husky": "^8.0.1",
"mrm": "^4.1.0",
"np": "^7.6.2",
"prettier": "^2.7.1",
"typescript": "^5.0.2"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"nyc": {
"exclude": [
"test"
],
"extension": [
".ts"
]
},
"dependencies": {
"@poppinss/inspect": "^1.0.1",
"@poppinss/utils": "^5.0.0",
"edge-error": "^3.0.0",
"edge-lexer": "^5.0.2",
"edge-parser": "^8.2.1",
"js-stringify": "^1.0.2",
"macroable": "^7.0.1",
"stringify-attributes": "^2.0.0"
},
"husky": {
"hooks": {
"commit-msg": "node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js"
}
},
"directories": {
"example": "examples",
"test": "test"
},
"keywords": [
"template",
"mustache",
"edge"
],
"publishConfig": {
"access": "public",
"tag": "latest"
},
"np": {
"contents": ".",
"anyBranch": false
},
"mrmConfig": {
"core": false,
"license": "MIT",
"services": [
"github-actions"
],
"minNodeVersion": "14.15.4",
"probotApps": [
"stale",
"lock"
],
"runGhActionsOnWindows": true
},
"eslintConfig": {
"extends": [
"plugin:adonis/typescriptPackage",
"prettier"
],
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
]
}
},
"eslintIgnore": [
"build"
],
"prettier": {
"trailingComma": "es5",
"semi": false,
"singleQuote": true,
"useTabs": false,
"quoteProps": "consistent",
"bracketSpacing": true,
"arrowParens": "always",
"printWidth": 100
}
}