Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oknoorap/wp-get-file-header
:pencil: Get WordPress file header information in nodejs
https://github.com/oknoorap/wp-get-file-header
nodejs wordpress wordpress-functions
Last synced: about 1 month ago
JSON representation
:pencil: Get WordPress file header information in nodejs
- Host: GitHub
- URL: https://github.com/oknoorap/wp-get-file-header
- Owner: oknoorap
- Created: 2017-04-11T06:27:29.000Z (almost 8 years ago)
- Default Branch: develop
- Last Pushed: 2017-06-09T02:29:54.000Z (over 7 years ago)
- Last Synced: 2024-12-02T12:38:40.496Z (about 1 month ago)
- Topics: nodejs, wordpress, wordpress-functions
- Language: JavaScript
- Homepage:
- Size: 77.1 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WordPress Get File Header
Get WordPress file header information, more details see https://codex.wordpress.org/File_Header.# Installation
Using npm:
`npm install wp-get-file-header`Using Yarn:
`yarn add wp-get-file-header`# Usage
Example codes below is run under nodejs at least with version 6.x.x installed```javascript
const wpFileHeader = require('wp-get-file-header')// 1st example
wpFileHeader('/example/wordpress/wp-content/themes/mytheme/style.css')
.then((info, arr) => {
console.log(info.themeName)
console.log(info.description)// Get origin info in Array
console.log(arr)
})// 2nd Example
wpFileHeader('/example/wordpress/wp-content/themes/mytheme/page-templates/full-width.php')
.then(page => {
console.log(page.templateName)
})
```# Related
* https://github.com/Ribhnux/deux
# License
MIT (c) [oknoorap](https://github.com/oknoorap)