Comparing version 0.0.1 to 0.0.2-next
{ | ||
"name": "shiki", | ||
"version": "0.0.1", | ||
"description": "ejs-like Javascript template", | ||
"main": "shiki.js", | ||
"version": "0.0.2-next", | ||
"main": "./out/main.js", | ||
"files": [ | ||
"data", | ||
"out" | ||
], | ||
"scripts": { | ||
"test": "mocha -R spec" | ||
"compile": "tsc -p .", | ||
"watch": "tsc -w -p ." | ||
}, | ||
"devDependencies": { | ||
"mocha": "1.18.x", | ||
"should": "3.3.x" | ||
"@types/node": "^10.12.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/esjeon/node-shiki" | ||
"dependencies": { | ||
"onigasm": "^2.2.1", | ||
"vscode-textmate": "^4.0.1" | ||
}, | ||
"keywords": [ | ||
"template" | ||
], | ||
"author": { | ||
"name": "Eon S. Jeon", | ||
"email": "esjeon@hyunmu.am" | ||
}, | ||
"license": "MIT/X", | ||
"bugs": { | ||
"url": "https://github.com/esjeon/node-shiki/issues" | ||
}, | ||
"homepage": "https://github.com/esjeon/node-shiki" | ||
"license": "MIT" | ||
} |
272
README.md
@@ -0,29 +1,257 @@ | ||
**shiki** | ||
Shiki 式 | ||
======== | ||
EJS-like Javascript template engine for Node.js | ||
Experimental [Onigasm](https://github.com/NeekSandhu/onigasm) based Syntax Highlighter. | ||
License | ||
------- | ||
MIT/X Consortium License | ||
```js | ||
const shiki = require('shiki') | ||
(c) 2014 Eon S. Jeon <esjeon@hyunmu.am> | ||
async function go() { | ||
const themedTokenizer = await shiki.getCodeTokenizer('light_plus') | ||
const tokenizingInfo = themedTokenizer("console.log('foo');", 'javascript') | ||
const html = shiki.buildHTML(tokenizingInfo, 'JavaScript') | ||
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: | ||
console.log(html) | ||
console.log(JSON.stringify(tokenizingInfo, null, 2)) | ||
} | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
go() | ||
``` | ||
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. | ||
`html` | ||
```html | ||
<pre class="shiki"><div class="language-id">JavaScript</div><code><span style="color: #267F99">console</span><span style="color: #000000">.</span><span style="color: #795E26">log</span><span style="color: #000000">(</span><span style="color: #A31515">'foo'</span><span style="color: #000000">);</span> | ||
</code></pre> | ||
``` | ||
`tokenizingInfo` | ||
```json | ||
[ | ||
[ | ||
{ | ||
"content": "console", | ||
"color": "#267F99", | ||
"explanation": [ | ||
{ | ||
"content": "console", | ||
"scopes": [ | ||
{ | ||
"scopeName": "source.js", | ||
"themeMatches": [] | ||
}, | ||
{ | ||
"scopeName": "support.class.console.js", | ||
"themeMatches": [ | ||
{ | ||
"name": "Types declaration and references", | ||
"scope": [ | ||
"meta.return-type", | ||
"support.class", | ||
"support.type", | ||
"entity.name.type", | ||
"entity.name.class", | ||
"storage.type.cs", | ||
"storage.type.generic.cs", | ||
"storage.type.modifier.cs", | ||
"storage.type.variable.cs", | ||
"storage.type.annotation.java", | ||
"storage.type.generic.java", | ||
"storage.type.java", | ||
"storage.type.object.array.java", | ||
"storage.type.primitive.array.java", | ||
"storage.type.primitive.java", | ||
"storage.type.token.java", | ||
"storage.type.groovy", | ||
"storage.type.annotation.groovy", | ||
"storage.type.parameters.groovy", | ||
"storage.type.generic.groovy", | ||
"storage.type.object.array.groovy", | ||
"storage.type.primitive.array.groovy", | ||
"storage.type.primitive.groovy" | ||
], | ||
"settings": { | ||
"foreground": "#267f99" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"content": ".", | ||
"color": "#000000", | ||
"explanation": [ | ||
{ | ||
"content": ".", | ||
"scopes": [ | ||
{ | ||
"scopeName": "source.js", | ||
"themeMatches": [] | ||
}, | ||
{ | ||
"scopeName": "punctuation.accessor.js", | ||
"themeMatches": [] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"content": "log", | ||
"color": "#795E26", | ||
"explanation": [ | ||
{ | ||
"content": "log", | ||
"scopes": [ | ||
{ | ||
"scopeName": "source.js", | ||
"themeMatches": [] | ||
}, | ||
{ | ||
"scopeName": "support.function.console.js", | ||
"themeMatches": [ | ||
{ | ||
"name": "Function declarations", | ||
"scope": [ | ||
"entity.name.function", | ||
"support.function" | ||
], | ||
"settings": { | ||
"foreground": "#795E26" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"content": "(", | ||
"color": "#000000", | ||
"explanation": [ | ||
{ | ||
"content": "(", | ||
"scopes": [ | ||
{ | ||
"scopeName": "source.js", | ||
"themeMatches": [] | ||
}, | ||
{ | ||
"scopeName": "meta.brace.round.js", | ||
"themeMatches": [] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"content": "'foo'", | ||
"color": "#A31515", | ||
"explanation": [ | ||
{ | ||
"content": "'", | ||
"scopes": [ | ||
{ | ||
"scopeName": "source.js", | ||
"themeMatches": [] | ||
}, | ||
{ | ||
"scopeName": "string.quoted.single.js", | ||
"themeMatches": [ | ||
{ | ||
"scope": "string", | ||
"settings": { | ||
"foreground": "#a31515" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"scopeName": "punctuation.definition.string.begin.js", | ||
"themeMatches": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"content": "foo", | ||
"scopes": [ | ||
{ | ||
"scopeName": "source.js", | ||
"themeMatches": [] | ||
}, | ||
{ | ||
"scopeName": "string.quoted.single.js", | ||
"themeMatches": [ | ||
{ | ||
"scope": "string", | ||
"settings": { | ||
"foreground": "#a31515" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"content": "'", | ||
"scopes": [ | ||
{ | ||
"scopeName": "source.js", | ||
"themeMatches": [] | ||
}, | ||
{ | ||
"scopeName": "string.quoted.single.js", | ||
"themeMatches": [ | ||
{ | ||
"scope": "string", | ||
"settings": { | ||
"foreground": "#a31515" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"scopeName": "punctuation.definition.string.end.js", | ||
"themeMatches": [] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"content": ");", | ||
"color": "#000000", | ||
"explanation": [ | ||
{ | ||
"content": ")", | ||
"scopes": [ | ||
{ | ||
"scopeName": "source.js", | ||
"themeMatches": [] | ||
}, | ||
{ | ||
"scopeName": "meta.brace.round.js", | ||
"themeMatches": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"content": ";", | ||
"scopes": [ | ||
{ | ||
"scopeName": "source.js", | ||
"themeMatches": [] | ||
}, | ||
{ | ||
"scopeName": "punctuation.terminator.statement.js", | ||
"themeMatches": [] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
] | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
1625818
1
97
0
0
34308
257
1
2
2
5
+ Addedonigasm@^2.2.1
+ Addedvscode-textmate@^4.0.1
+ Addedlru-cache@5.1.1(transitive)
+ Addednan@2.22.0(transitive)
+ Addedonigasm@2.2.5(transitive)
+ Addedoniguruma@7.2.3(transitive)
+ Addedvscode-textmate@4.4.0(transitive)
+ Addedyallist@3.1.1(transitive)