Name: YoastSEO.js
Owner: Artsy
Description: Analyze content on a page and give SEO feedback as well as render a snippet preview.
Forked from: Yoast/YoastSEO.js
Created: 2016-09-02 16:07:24.0
Updated: 2016-10-22 09:37:12.0
Pushed: 2017-01-10 21:50:49.0
Size: 5087
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Text analysis and assessment library in JavaScript. This library can generate interesting metrics about a text and assess these metrics to give you an assessment which can be used to improve the text.
Also included is a preview of the Google search results which can be assessed using the library.
You can install YoastSEO.js using npm:
install https://github.com/Yoast/YoastSEO.js#develop
If you want the complete experience with UI and everything you can use the App
. You need to have a few HTML elements to make this work: A snippet preview container, a focusKeyword input element and a content input field.
SnippetPreview = require( "yoastseo" ).SnippetPreview;
App = require( "yoastseo" ).App;
ow.onload = function() {
var focusKeywordField = document.getElementById( "focusKeyword" );
var contentField = document.getElementById( "content" );
var snippetPreview = new SnippetPreview({
targetElement: document.getElementById( "snippet" )
});
var app = new App({
snippetPreview: snippetPreview,
targets: {
output: "output"
},
callbacks: {
getData: function() {
return {
keyword: focusKeywordField.value,
text: contentField.value
};
}
}
});
app.refresh();
focusKeywordField.addEventListener( 'change', app.analyzeTimer.bind( app ) );
contentField.addEventListener( 'change', app.analyzeTimer.bind( app ) );
You can also invoke internal components directly to be able to work with the raw data. To get metrics about the text you can use the Researcher
:
Researcher = require( "yoastseo" ).Researcher;
researcher = new Researcher( new Paper( "Text that has been written" ) );
ole.log( researcher.getResearch( "wordCountInText" ) );
Please see CHANGELOG for more information what has changed recently.
The data that will be analyzed by YoastSEO.js can be modified by plugins. Plugins can also add new research and assessments. To find out how to do this, checkout out the customization documentation.
test
Generate coverage using the --coverage
flag.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email security [at] yoast.com instead of using the issue tracker.
We follow the GPL. Please see License file for more information.